[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-17 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r456442911



##
File path: 
oap-server/server-configuration/configuration-k8s-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigurationConfigmapInformer.java
##
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.informer.SharedIndexInformer;
+import io.kubernetes.client.informer.SharedInformerFactory;
+import io.kubernetes.client.informer.cache.Lister;
+import io.kubernetes.client.openapi.ApiClient;
+import io.kubernetes.client.openapi.apis.CoreV1Api;
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import io.kubernetes.client.openapi.models.V1ConfigMapList;
+import io.kubernetes.client.util.Config;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class ConfigurationConfigmapInformer {
+
+private Lister configMapLister;
+
+private SharedInformerFactory factory;
+
+private final ExecutorService executorService = 
Executors.newSingleThreadExecutor(r -> {
+Thread thread = new Thread(r, 
"SKYWALKING_KUBERNETES_CONFIGURATION_INFORMER");
+thread.setDaemon(true);
+return thread;
+});
+
+public ConfigurationConfigmapInformer(ConfigmapConfigurationSettings 
settings) {
+

Review comment:
   An unnecessary empty line.

##
File path: 
oap-server/server-configuration/configuration-k8s-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigmapConfigurationSettings.java
##
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+
+@Setter
+@Getter
+public class ConfigmapConfigurationSettings extends ModuleConfig {
+

Review comment:
   An unnecessary empty line.

##
File path: 
oap-server/server-configuration/configuration-k8s-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigmapConfigurationWatcherRegister.java
##
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.openapi.models.V1ConfigMa

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-16 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r455745070



##
File path: oap-server/server-bootstrap/src/main/resources/application.yml
##
@@ -264,6 +264,10 @@ configuration:
 period: ${SW_CONFIG_CONSUL_PERIOD:1}
 # Consul aclToken
 aclToken: ${SW_CONFIG_CONSUL_ACL_TOKEN:""}
+  k8s_configmap:

Review comment:
   Sorry for I commented wrong before.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-16 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r455741399



##
File path: all-dependencies-es7.txt
##
@@ -0,0 +1,211 @@
+HdrHistogram-2.1.9.jar

Review comment:
   I think this should not be committed? And the next file?

##
File path: oap-server/server-bootstrap/src/main/resources/application.yml
##
@@ -264,6 +264,10 @@ configuration:
 period: ${SW_CONFIG_CONSUL_PERIOD:1}
 # Consul aclToken
 aclToken: ${SW_CONFIG_CONSUL_ACL_TOKEN:""}
+  k8s_configmap:

Review comment:
   ```suggestion
 k8s-configmap:
   ```
   
   Same here, by following other module and provider style.

##
File path: oap-server/server-configuration/configuration-k8s_configmap/pom.xml
##
@@ -0,0 +1,54 @@
+
+
+
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+server-configuration
+org.apache.skywalking
+8.1.0-SNAPSHOT
+
+4.0.0
+
+configuration-k8s_configmap

Review comment:
   `oap-server/server-configuration/configuration-k8s_configmap` should be 
`oap-server/server-configuration/configuration-k8s-configmap`

##
File path: 
oap-server/server-configuration/configuration-k8s_configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigurationConfigmapInformer.java
##
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.informer.SharedIndexInformer;
+import io.kubernetes.client.informer.SharedInformerFactory;
+import io.kubernetes.client.informer.cache.Lister;
+import io.kubernetes.client.openapi.ApiClient;
+import io.kubernetes.client.openapi.apis.CoreV1Api;
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import io.kubernetes.client.openapi.models.V1ConfigMapList;
+import io.kubernetes.client.util.Config;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class ConfigurationConfigmapInformer {
+
+private Lister configMapLister;
+
+private SharedInformerFactory factory;
+
+private final ExecutorService executorService = 
Executors.newSingleThreadExecutor(r -> {
+Thread thread = new Thread(r, 
"SKYWALKING_KUBERNETES_CONFIGURATION_INFORMER");
+thread.setDaemon(true);
+return thread;
+});
+
+public ConfigurationConfigmapInformer(ConfigmapConfigurationSettings 
settings) {
+
+try {
+doStartConfigMapInformer(settings);
+doAddShutdownHook();
+} catch (IOException e) {
+log.error("cannot connect with api server in kubernetes", e);
+}
+
+}
+
+private void doAddShutdownHook() {
+Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+if (Objects.nonNull(factory)) {
+factory.stopAllRegisteredInformers();
+}
+}));
+}
+
+private void doStartConfigMapInformer(final ConfigmapConfigurationSettings 
settings) throws IOException {
+ApiClient apiClient = Config.defaultClient();
+
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().readTimeout(0, 
TimeUnit.SECONDS).build());
+CoreV1Api coreV1Api = new CoreV1Api(apiClient);
+
+factory = new SharedInformerFactory(executorService);
+
+SharedIndexInformer configMapSharedIndexInformer = 
factory.sharedIndexInformerFor(
+params -> coreV1Api.listNamespacedConfigMapCall(
+settings.getNamespace(), null, null, null, null, 
settings.getLabelSelector()
+, 1, params.resourceVersion, params.timeoutSeconds, 
params.watch, null
+),
+V1ConfigMap.class, V1ConfigMapList.class
+);
+
+factory.startAllRegisteredInformers();
+configMapLister 

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-14 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r454175922



##
File path: 
oap-server/server-configuration/configuration-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigmapConfigurationWatcherRegister.java
##
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import java.util.Optional;
+import java.util.Set;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.configuration.api.ConfigTable;
+import 
org.apache.skywalking.oap.server.configuration.api.ConfigWatcherRegister;
+
+@Slf4j
+public class ConfigmapConfigurationWatcherRegister extends 
ConfigWatcherRegister {
+
+private final ConfigurationConfigmapInformer informer;
+
+public 
ConfigmapConfigurationWatcherRegister(ConfigmapConfigurationSettings settings,
+ 
ConfigurationConfigmapInformer informer) {
+super(settings.getPeriod());
+this.informer = informer;
+}
+
+@Override
+public Optional readConfig(Set keys) {
+final ConfigTable configTable = new ConfigTable();
+
+Optional v1ConfigMap = informer.configMap();
+
+for (final String name : keys) {
+
+final String value = v1ConfigMap.map(configMap -> 
configMap.getData().get(name)).orElse(null);

Review comment:
   If you can't read the key from configmap, please don't include value in 
the ConfigTable. I received a report today, someone accidentally reset the 
default value, even they didn't config the new value in the dynamic 
configuration center.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-14 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r454175080



##
File path: oap-server/server-configuration/configuration-configmap/pom.xml
##
@@ -0,0 +1,54 @@
+
+
+
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+server-configuration
+org.apache.skywalking
+8.1.0-SNAPSHOT
+
+4.0.0
+
+configuration-configmap

Review comment:
   Have you finished all these changes?





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-12 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r453327450



##
File path: 
oap-server/server-configuration/configuration-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigmapConfigurationProvider.java
##
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import com.google.common.base.Strings;
+import 
org.apache.skywalking.oap.server.configuration.api.AbstractConfigurationProvider;
+import 
org.apache.skywalking.oap.server.configuration.api.ConfigWatcherRegister;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+import org.apache.skywalking.oap.server.library.module.ModuleStartException;
+
+public class ConfigmapConfigurationProvider extends 
AbstractConfigurationProvider {
+
+private final ConfigmapConfigurationSettings settings;
+
+public ConfigmapConfigurationProvider() {
+this.settings = new ConfigmapConfigurationSettings();
+}
+
+@Override
+public String name() {
+return "configmap";

Review comment:
   ```suggestion
   return "k8s_configmap";
   ```
   
   And please change other docs related to this.

##
File path: oap-server/server-configuration/configuration-configmap/pom.xml
##
@@ -0,0 +1,54 @@
+
+
+
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+server-configuration
+org.apache.skywalking
+8.1.0-SNAPSHOT
+
+4.0.0
+
+configuration-configmap

Review comment:
   ```suggestion
   configuration-k8s-configmap
   ```

##
File path: 
oap-server/server-configuration/configuration-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigmapConfigurationProvider.java
##
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import com.google.common.base.Strings;
+import 
org.apache.skywalking.oap.server.configuration.api.AbstractConfigurationProvider;
+import 
org.apache.skywalking.oap.server.configuration.api.ConfigWatcherRegister;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+import org.apache.skywalking.oap.server.library.module.ModuleStartException;
+
+public class ConfigmapConfigurationProvider extends 
AbstractConfigurationProvider {
+
+private final ConfigmapConfigurationSettings settings;
+
+public ConfigmapConfigurationProvider() {
+this.settings = new ConfigmapConfigurationSettings();
+}
+
+@Override
+public String name() {
+return "configmap";

Review comment:
   ```suggestion
   return "k8s_configmap";
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-07 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r451231254



##
File path: 
oap-server/server-configuration/configuration-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigurationConfigmapInformer.java
##
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.informer.SharedIndexInformer;
+import io.kubernetes.client.informer.SharedInformerFactory;
+import io.kubernetes.client.informer.cache.Lister;
+import io.kubernetes.client.openapi.ApiClient;
+import io.kubernetes.client.openapi.apis.CoreV1Api;
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import io.kubernetes.client.openapi.models.V1ConfigMapList;
+import io.kubernetes.client.util.Config;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public enum ConfigurationConfigmapInformer {

Review comment:
   I hope it should a logic singleton, rather than an enum. Because you 
have the provider initialization process to make sure there is only one 
instance. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-07 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r451212002



##
File path: docs/en/setup/backend/dynamic-config.md
##
@@ -102,3 +102,16 @@ configuration:
 appId: ${SW_CONFIG_APOLLO_APP_ID:skywalking}
 period: ${SW_CONFIG_APOLLO_PERIOD:5}
 ```
+
+## Dynamic Configuration Kuberbetes Configmap Implementation
+
+[configmap](https://kubernetes.io/docs/concepts/configuration/configmap/) is 
also supported as DCC(Dynamic Configuration Center), to use it, just configured 
as follows:
+
+```yaml
+configuration:
+  selector: ${SW_CONFIGURATION:configmap}
+  configmap:
+  period: ${SW_CONFIG_CONSUL_PERIOD:60}
+  namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
+  labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
+```

Review comment:
   And please link the `skywalking-dynamic-configmap.example.yaml` as an 
example here.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-07 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r451211757



##
File path: 
oap-server/server-configuration/configuration-configmap/src/main/java/org/apache/skywalking/oap/server/configuration/configmap/ConfigurationConfigmapInformer.java
##
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.configuration.configmap;
+
+import io.kubernetes.client.informer.SharedIndexInformer;
+import io.kubernetes.client.informer.SharedInformerFactory;
+import io.kubernetes.client.informer.cache.Lister;
+import io.kubernetes.client.openapi.ApiClient;
+import io.kubernetes.client.openapi.apis.CoreV1Api;
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import io.kubernetes.client.openapi.models.V1ConfigMapList;
+import io.kubernetes.client.util.Config;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public enum ConfigurationConfigmapInformer {

Review comment:
   Why enum? Typically, we recommend don't' do this, unless you have to.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-07-07 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r451211434



##
File path: docs/en/setup/backend/dynamic-config.md
##
@@ -102,3 +102,16 @@ configuration:
 appId: ${SW_CONFIG_APOLLO_APP_ID:skywalking}
 period: ${SW_CONFIG_APOLLO_PERIOD:5}
 ```
+
+## Dynamic Configuration Kuberbetes Configmap Implementation
+
+[configmap](https://kubernetes.io/docs/concepts/configuration/configmap/) is 
also supported as DCC(Dynamic Configuration Center), to use it, just configured 
as follows:
+
+```yaml
+configuration:
+  selector: ${SW_CONFIGURATION:configmap}
+  configmap:
+  period: ${SW_CONFIG_CONSUL_PERIOD:60}
+  namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
+  labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
+```

Review comment:
   Please add descriptions about how the `labelSelector` works.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4959: Configmap configuration

2020-06-22 Thread GitBox


wu-sheng commented on a change in pull request #4959:
URL: https://github.com/apache/skywalking/pull/4959#discussion_r443512419



##
File path: oap-server/server-configuration/configuration-configmap/pom.xml
##
@@ -0,0 +1,31 @@
+

Review comment:
   I think you missed this license.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org