Explorar o código

refactor: delete k8s.app_name config

Zaiming (Stone) Shi %!s(int64=3) %!d(string=hai) anos
pai
achega
05782c4e4e

+ 7 - 26
apps/emqx_conf/i18n/emqx_conf_schema.conf

@@ -353,17 +353,14 @@ It is refreshed automatically, as long as the node is alive.
 
   cluster_k8s_address_type {
     desc {
-      en: """Address type used for connecting to the discovered nodes."""
+      en: """Address type used for connecting to the discovered nodes.
+setting <code>cluster.k8s.address_type</code> to <code>ip</code> will
+make EMQX to discover IP addresses of peer nodes from Kubernetes API.
+"""
       zh: """当使用 k8s 方式集群时,address_type 用来从 Kubernetes 接口的应答里获取什么形式的 Host 列表。
-指定 cluster.k8s.address_type 为 ip,则将从 Kubernetes 接口中获取 emqx 服务的 IP 地址列表:
-- 172.16.122.31 </br>
-- 172.16.122.32 </br>
-- 172.16.122.33 </br>
-然后与 cluster.k8s.app_name 配置指定的 app name 拼接,得到 emqx 节点列表: </br>
-- emqx@172.16.122.31
-- emqx@172.16.122.32
-- emqx@172.16.122.33
-          """
+指定 <code>cluster.k8s.address_type</code. 为 <code>ip</code>,则将从 Kubernetes 接口中获取集群中其他节点
+的IP地址。
+"""
     }
     label {
       en: "K8s Address Type"
@@ -371,22 +368,6 @@ It is refreshed automatically, as long as the node is alive.
     }
   }
 
-  cluster_k8s_app_name {
-    desc {
-      en: """This parameter should be set to the part of the <code>node.name</code>
-before the '@'.</br>
-For example, if the <code>node.name</code> is <code>emqx@127.0.0.1</code>, then this parameter
-should be set to <code>emqx</code>."""
-      zh: """app_name 用来跟获取的 Host 列表拼接,得到节点列表。</br>
-当 cluster.discovery_strategy 为 k8s 时,此配置项才有效。
-          """
-    }
-    label {
-      en: "K8s App Name"
-      zh: "K8s 节点名前缀"
-    }
-  }
-
   cluster_k8s_namespace {
     desc {
       en: """Kubernetes namespace."""

+ 0 - 10
apps/emqx_conf/src/emqx_conf_schema.erl

@@ -364,15 +364,6 @@ fields(cluster_k8s) ->
                     'readOnly' => true
                 }
             )},
-        {"app_name",
-            sc(
-                string(),
-                #{
-                    default => "emqx",
-                    'readOnly' => true,
-                    desc => ?DESC(cluster_k8s_app_name)
-                }
-            )},
         {"namespace",
             sc(
                 string(),
@@ -1320,7 +1311,6 @@ options(k8s, Conf) ->
         {apiserver, conf_get("cluster.k8s.apiserver", Conf)},
         {service_name, conf_get("cluster.k8s.service_name", Conf)},
         {address_type, conf_get("cluster.k8s.address_type", Conf, ip)},
-        {app_name, conf_get("cluster.k8s.app_name", Conf)},
         {namespace, conf_get("cluster.k8s.namespace", Conf)},
         {suffix, conf_get("cluster.k8s.suffix", Conf, "")}
     ];

+ 0 - 2
deploy/charts/emqx/templates/StatefulSet.yaml

@@ -117,8 +117,6 @@ spec:
           env:
           - name: EMQX_NAME
             value: {{ .Release.Name }}
-          - name: EMQX_CLUSTER__K8S__APP_NAME
-            value: {{ .Release.Name }}
           - name: EMQX_CLUSTER__DISCOVERY_STRATEGY
             value: k8s
           - name: EMQX_CLUSTER__K8S__SERVICE_NAME