This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a1b1fa1 [charts] Update operator splice (#616)
2a1b1fa1 is described below

commit 2a1b1fa16336799246d3f5ee33ca07e2398d8f9d
Author: Jian Zhong <[email protected]>
AuthorDate: Wed Feb 19 20:04:19 2025 +0800

    [charts] Update operator splice (#616)
---
 manifests/addons/{env.sh => gen.sh}                |   0
 .../nacos/files/profile-demo.yaml}                 |  19 +---
 .../register-discovery/nacos/templates/NOTES.txt   |  22 ----
 .../nacos/templates/_helpers.tpl                   |  77 ++++++-------
 .../nacos/templates/configmap.yaml                 |   4 +-
 .../nacos/templates/service.yaml                   |   4 +-
 .../nacos/templates/statefulset.yaml               |   8 +-
 .../nacos/templates/zzz_profile.yaml               |  19 ++++
 .../register-discovery/nacos/values.yaml           |  18 ++-
 .../zookeeper/files/profile-demo.yaml}             |  19 +---
 .../zookeeper/templates/NOTES.txt                  |  22 ----
 .../zookeeper/templates/_helpers.tpl               | 121 ++++++++++++++-------
 .../zookeeper/templates/configmap.yaml             |   6 +-
 .../zookeeper/templates/service.yaml               |   8 +-
 .../zookeeper/templates/statefulset.yaml           |  10 +-
 .../zookeeper/templates/zzz_profile.yaml           |  19 ++++
 .../register-discovery/zookeeper/values.yaml       |  18 ++-
 manifests/profiles/empty.yaml                      |   2 +-
 operator/pkg/component/component.go                |   9 +-
 operator/pkg/install/installer.go                  |   4 +-
 20 files changed, 207 insertions(+), 202 deletions(-)

diff --git a/manifests/addons/env.sh b/manifests/addons/gen.sh
similarity index 100%
rename from manifests/addons/env.sh
rename to manifests/addons/gen.sh
diff --git a/manifests/profiles/empty.yaml 
b/manifests/charts/dubbo-control/register-discovery/nacos/files/profile-demo.yaml
similarity index 71%
copy from manifests/profiles/empty.yaml
copy to 
manifests/charts/dubbo-control/register-discovery/nacos/files/profile-demo.yaml
index 5230fb81..13878a13 100644
--- a/manifests/profiles/empty.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/files/profile-demo.yaml
@@ -11,21 +11,4 @@
 # 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.
-
-apiVersion: install.dubbo.io/v1alpha1
-kind: DubboOperator
-spec:
-  control: register
-  components:
-    base:
-      enabled: false
-    register:
-      nacos:
-        enabled: true
-      zookeeper:
-        enabled: false
-  dashboard:
-    admin:
-      enabled: false
-
+# limitations under the License.
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/NOTES.txt 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/NOTES.txt
index 68957f97..e69de29b 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/NOTES.txt
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/NOTES.txt
@@ -1,22 +0,0 @@
-1. Get the application URL by running these commands:
-{{- if .Values.ingress.enabled }}
-{{- range $host := .Values.ingress.hosts }}
-  {{- range .paths }}
-  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
-  {{- end }}
-{{- end }}
-{{- else if contains "NodePort" .Values.service.type }}
-  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o 
jsonpath="{.spec.ports[0].nodePort}" services {{ include "nacos.fullname" . }})
-  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o 
jsonpath="{.items[0].status.addresses[0].address}")
-  echo http://$NODE_IP:$NODE_PORT
-{{- else if contains "LoadBalancer" .Values.service.type }}
-     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
-           You can watch its status by running 'kubectl get --namespace {{ 
.Release.Namespace }} svc -w {{ include "nacos.fullname" . }}'
-  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ 
include "nacos.fullname" . }} --template "{{"{{ range (index 
.status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
-  echo http://$SERVICE_IP:{{ .Values.service.port }}
-{{- else if contains "ClusterIP" .Values.service.type }}
-  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l 
"app.kubernetes.io/name={{ include "nacos.name" . 
}},app.kubernetes.io/instance={{ .Release.Name }}" -o 
jsonpath="{.items[0].metadata.name}")
-  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
-  echo "Visit http://127.0.0.1:8080 to use your application"
-  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 
8080:$CONTAINER_PORT
-{{- end }}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/_helpers.tpl
 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/_helpers.tpl
index 7ac8e6db..acda8872 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/_helpers.tpl
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/_helpers.tpl
@@ -1,62 +1,53 @@
 {{/*
-Expand the name of the chart.
+Return the appropriate apiVersion for deployment or statefulset.
 */}}
-{{- define "nacos.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to 
this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "nacos.fullname" -}}
-{{- if .Values.fullnameOverride }}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- define "apiVersion" -}}
+{{- if and ($.Capabilities.APIVersions.Has "apps/v1") (semverCompare ">= 
1.14-0" .Capabilities.KubeVersion.Version) }}
+{{- print "apps/v1" }}
 {{- else }}
-{{- $name := default .Chart.Name .Values.nameOverride }}
-{{- if contains $name .Release.Name }}
-{{- .Release.Name | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
-{{- end }}
+{{- print "extensions/v1beta1" }}
 {{- end }}
 {{- end }}
 
 {{/*
-Create chart name and version as used by the chart label.
+Return Nacos Name to use.
 */}}
-{{- define "nacos.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | 
trimSuffix "-" }}
-{{- end }}
+{{- define "nacos.name" -}}
+{{- printf "nacos" -}}
+{{- end -}}
 
 {{/*
-Common labels
+Return Nacos Labels to use.
 */}}
 {{- define "nacos.labels" -}}
-helm.sh/chart: {{ include "nacos.chart" . }}
-{{ include "nacos.selectorLabels" . }}
-{{- if .Chart.AppVersion }}
-app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
-{{- end }}
+app: {{ template "nacos.name" . }}
+app.kubernetes.io/name: {{ template "nacos.name" . }}
+app.kubernetes.io/instance: {{ template "nacos.name" . }}
+app.kubernetes.io/component: {{ template "nacos.name" . }}
 app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end }}
+{{- end -}}
 
 {{/*
-Selector labels
+Return Nacos matchLabels to use.
 */}}
-{{- define "nacos.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "nacos.name" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
+{{- define "nacos.matchLabels" -}}
+app.kubernetes.io/name: {{ template "nacos.name" . }}
+app.kubernetes.io/instance: {{ template "nacos.name" . }}
+app.kubernetes.io/component: {{ template "nacos.name" . }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
 
 {{/*
-Create the name of the service account to use
+Return Nacos Service Selector to use.
 */}}
-{{- define "nacos.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "nacos.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
+{{- define "nacos.selector" -}}
+{{ include "nacos.name" . }}
+{{- end -}}
+
+{{/*
+Return Nacos Port to use.
+*/}}
+{{- define "nacos.port" -}}
+{{- printf "8848" -}}
+{{- end -}}
+
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
index a5268eb8..fc076779 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
@@ -1,10 +1,10 @@
 {{- $nacos := .Values.nacos -}}
-{{- if and $nacos.enabled (eq $nacos.storage.type "mysql") }}
+{{- if $nacos.storage.type "mysql" }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: {{ template "nacos.name" . }}-db-config
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "nacos.labels" . | nindent 4 }}
   {{- with $nacos.labels }}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/service.yaml
 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/service.yaml
index 2940deaf..1acac955 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/service.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/service.yaml
@@ -1,11 +1,10 @@
 {{- $nacos := .Values.nacos -}}
 {{- $service := $nacos.service -}}
-{{- if $nacos.enabled }}
 apiVersion: v1
 kind: Service
 metadata:
   name: {{ template "nacos.name" . }}
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "nacos.labels" . | nindent 4 }}
   {{- with $nacos.labels }}
@@ -104,4 +103,3 @@ spec:
   selector:
     app: {{ template "nacos.selector" . }}
 {{- end -}}
-{{- end -}}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
index 30bcde0f..d9e01e16 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
@@ -1,10 +1,9 @@
-{{- $nacos := .Values.nacos -}}
-{{- if $nacos.enabled }}
+{{- $nacos := .Values -}}
 apiVersion: {{ template "apiVersion" . }}
 kind: StatefulSet
 metadata:
   name: {{ template "nacos.name" . }}
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "nacos.labels" . | nindent 4 }}
   {{- with $nacos.labels }}
@@ -143,5 +142,4 @@ spec:
           subPath: logs
       volumes:
       - name: data
-        emptyDir: {}
-{{- end -}}
\ No newline at end of file
+        emptyDir: {}
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/templates/zzz_profile.yaml
 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/zzz_profile.yaml
new file mode 100644
index 00000000..32c3348c
--- /dev/null
+++ 
b/manifests/charts/dubbo-control/register-discovery/nacos/templates/zzz_profile.yaml
@@ -0,0 +1,19 @@
+{{- if $.Values.defaults}}
+{{ fail (cat
+  "`--set defaults.foo=bar` with `--set foo=bar`. Defaults set:\n"
+  ($.Values.defaults | toYaml |nindent 4) ) }}
+{{- end }}
+{{- $defaults := $.Values._internal_default_values_not_set }}
+{{- $_ := unset $.Values "_internal_default_values_not_set " }}
+{{- $profile := dict }}
+{{- with (coalesce ($.Values).profile ($.Values.global).profile) }}
+{{- with $.Files.Get (printf "files/profile-%s.yaml" .)}}
+{{- $profile = (. | fromYaml) }}
+{{- else }}
+{{ fail (cat "unknown profile" .) }}
+{{- end }}
+{{- end }}
+{{- if false }}
+{{- $a := mustMergeOverwrite $defaults ($profile.global) ($.Values.global | 
default dict)  }}
+{{- end }}
+{{- $b := set $ "Values" (mustMergeOverwrite $defaults $.Values) }}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/nacos/values.yaml 
b/manifests/charts/dubbo-control/register-discovery/nacos/values.yaml
index 0d975919..6792fbb9 100644
--- a/manifests/charts/dubbo-control/register-discovery/nacos/values.yaml
+++ b/manifests/charts/dubbo-control/register-discovery/nacos/values.yaml
@@ -1,9 +1,21 @@
+# 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.
+
 _internal_default_values_not_set:
   global:
     dubboNamespace: dubbo-system
-nacos:
-  ## Whether to enable the nacos.
-  enabled: true
   ## Specifies the mode in which nacos is running (standalone, cluster, etc.).
   mode: standalone
   ## Override the namespace where the resource is deployed.
diff --git a/manifests/profiles/empty.yaml 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/files/profile-demo.yaml
similarity index 71%
copy from manifests/profiles/empty.yaml
copy to 
manifests/charts/dubbo-control/register-discovery/zookeeper/files/profile-demo.yaml
index 5230fb81..13878a13 100644
--- a/manifests/profiles/empty.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/files/profile-demo.yaml
@@ -11,21 +11,4 @@
 # 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.
-
-apiVersion: install.dubbo.io/v1alpha1
-kind: DubboOperator
-spec:
-  control: register
-  components:
-    base:
-      enabled: false
-    register:
-      nacos:
-        enabled: true
-      zookeeper:
-        enabled: false
-  dashboard:
-    admin:
-      enabled: false
-
+# limitations under the License.
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/NOTES.txt
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/NOTES.txt
index d0323498..e69de29b 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/NOTES.txt
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/NOTES.txt
@@ -1,22 +0,0 @@
-1. Get the application URL by running these commands:
-{{- if .Values.ingress.enabled }}
-{{- range $host := .Values.ingress.hosts }}
-  {{- range .paths }}
-  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
-  {{- end }}
-{{- end }}
-{{- else if contains "NodePort" .Values.service.type }}
-  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o 
jsonpath="{.spec.ports[0].nodePort}" services {{ include "zookeeper.fullname" . 
}})
-  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o 
jsonpath="{.items[0].status.addresses[0].address}")
-  echo http://$NODE_IP:$NODE_PORT
-{{- else if contains "LoadBalancer" .Values.service.type }}
-     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
-           You can watch its status by running 'kubectl get --namespace {{ 
.Release.Namespace }} svc -w {{ include "zookeeper.fullname" . }}'
-  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ 
include "zookeeper.fullname" . }} --template "{{"{{ range (index 
.status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
-  echo http://$SERVICE_IP:{{ .Values.service.port }}
-{{- else if contains "ClusterIP" .Values.service.type }}
-  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l 
"app.kubernetes.io/name={{ include "zookeeper.name" . 
}},app.kubernetes.io/instance={{ .Release.Name }}" -o 
jsonpath="{.items[0].metadata.name}")
-  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
-  echo "Visit http://127.0.0.1:8080 to use your application"
-  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 
8080:$CONTAINER_PORT
-{{- end }}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/_helpers.tpl
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/_helpers.tpl
index 64d8ce47..df8fd864 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/_helpers.tpl
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/_helpers.tpl
@@ -1,62 +1,99 @@
 {{/*
-Expand the name of the chart.
+Return the appropriate apiVersion for deployment or statefulset.
 */}}
-{{- define "zookeeper.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- define "apiVersion" -}}
+{{- if and ($.Capabilities.APIVersions.Has "apps/v1") (semverCompare ">= 
1.14-0" .Capabilities.KubeVersion.Version) }}
+{{- print "apps/v1" }}
+{{- else }}
+{{- print "extensions/v1beta1" }}
+{{- end }}
 {{- end }}
 
 {{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to 
this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
+Return the ZooKeeper client-server authentication credentials secret.
 */}}
-{{- define "zookeeper.fullname" -}}
-{{- if .Values.fullnameOverride }}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- $name := default .Chart.Name .Values.nameOverride }}
-{{- if contains $name .Release.Name }}
-{{- .Release.Name | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
-{{- end }}
-{{- end }}
-{{- end }}
+{{- define "zoo.client.secretName" -}}
+{{- $zoo := .Values.registerCentre.zookeeper -}}
+{{- if $zoo.auth.client.existingSecret -}}
+    {{- printf "%s" (tpl $zoo.auth.client.existingSecret $) -}}
+{{- else -}}
+    {{- printf "%s-client-auth" (include "zoo.name" .) -}}
+{{- end -}}
+{{- end -}}
 
 {{/*
-Create chart name and version as used by the chart label.
+Return the ZooKeeper server-server authentication credentials secret.
 */}}
-{{- define "zookeeper.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | 
trimSuffix "-" }}
-{{- end }}
+{{- define "zoo.quorum.secretName" -}}
+{{- $zoo := .Values.registerCentre.zookeeper -}}
+{{- if $zoo.auth.quorum.existingSecret -}}
+    {{- printf "%s" (tpl $zoo.auth.quorum.existingSecret $) -}}
+{{- else -}}
+    {{- printf "%s-quorum-auth" (include "zoo.name" .) -}}
+{{- end -}}
+{{- end -}}
 
 {{/*
-Common labels
+Return ZooKeeper Labels to use.
 */}}
-{{- define "zookeeper.labels" -}}
-helm.sh/chart: {{ include "zookeeper.chart" . }}
-{{ include "zookeeper.selectorLabels" . }}
-{{- if .Chart.AppVersion }}
-app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
-{{- end }}
+{{- define "zoo.labels" -}}
+app: {{ template "zoo.name" . }}
+app.kubernetes.io/name: {{ template "zoo.name" . }}
+app.kubernetes.io/instance: {{ template "zoo.name" . }}
+app.kubernetes.io/component: {{ template "zoo.name" . }}
 app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end }}
+{{- end -}}
+
 
 {{/*
-Selector labels
+Return ZooKeeper matchLabels to use.
 */}}
-{{- define "zookeeper.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "zookeeper.name" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
+{{- define "zoo.matchLabels" -}}
+app.kubernetes.io/name: {{ template "zoo.name" . }}
+app.kubernetes.io/instance: {{ template "zoo.name" . }}
+app.kubernetes.io/component: {{ template "zoo.name" . }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
 
 {{/*
-Create the name of the service account to use
+Return ZooKeeper Name to use.
 */}}
-{{- define "zookeeper.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "zookeeper.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
+{{- define "zoo.name" -}}
+{{- printf "zookeeper" -}}
+{{- end -}}
+
+{{/*
+Return Dubbo Namespace to use.
+*/}}
+{{- define "admin.namespace" -}}
+{{- "dubbo-system" | default }}
 {{- end }}
+
+{{/*
+Return ZooKeeper Service Selector to use.
+*/}}
+{{- define "zoo.selector" -}}
+{{ include "zoo.name" . }}
+{{- end -}}
+
+
+{{/*
+Return ZooKeeper Client Port to use.
+*/}}
+{{- define "zoo.client" -}}
+{{- printf "2181" -}}
+{{- end -}}
+
+{{/*
+Return ZooKeeper Follower Port to use.
+*/}}
+{{- define "zoo.follower" -}}
+{{- printf "2888" -}}
+{{- end -}}
+
+{{/*
+Return ZooKeeper Election Port to use.
+*/}}
+{{- define "zoo.election" -}}
+{{- printf "3888" -}}
+{{- end -}}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/configmap.yaml
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/configmap.yaml
index 6ccbdb4d..f87fceb8 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/configmap.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/configmap.yaml
@@ -1,10 +1,9 @@
 {{- $zoo := .Values.zookeeper -}}
-{{- if $zoo.enabled }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: {{ template "zoo.name" . }}-scripts
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "zoo.labels" . | nindent 4 }}
   {{- with $zoo.labels }}
@@ -34,5 +33,4 @@ data:
             exit 1
         fi
     fi
-    exec /entrypoint.sh /run.sh
-{{- end -}}
\ No newline at end of file
+    exec /entrypoint.sh /run.sh
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/service.yaml
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/service.yaml
index 158844da..fc803e93 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/service.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/service.yaml
@@ -1,11 +1,10 @@
 {{- $zoo := .Values.zookeeper -}}
 {{- $service := $zoo.service -}}
-{{- if .Values.zookeeper.enabled }}
 apiVersion: v1
 kind: Service
 metadata:
   name: {{ template "zoo.name" . }}
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "zoo.labels" . | nindent 4 }}
   {{- with $zoo.labels }}
@@ -51,7 +50,7 @@ apiVersion: v1
 kind: Service
 metadata:
   name: {{ template "zoo.name" . }}-headless
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "zoo.labels" . | nindent 4 }}
   {{- with .Values.labels }}
@@ -98,5 +97,4 @@ spec:
     port: {{ template "zoo.election" . }}
     targetPort: election
   selector:
-    app: {{ template "zoo.selector" . }}
-{{- end -}}
\ No newline at end of file
+    app: {{ template "zoo.selector" . }}
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/statefulset.yaml
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/statefulset.yaml
index f5a806dd..f067057f 100644
--- 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/statefulset.yaml
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/statefulset.yaml
@@ -1,10 +1,9 @@
-{{- $zoo := .Values.zookeeper -}}
-{{- if $zoo.enabled }}
+{{- $zoo := .Values -}}
 apiVersion: {{ template "apiVersion" . }}
 kind: StatefulSet
 metadata:
   name: {{ template "zoo.name" . }}
-  namespace: {{ template "admin.namespace" . }}
+  namespace: {{ .Release.Namespace }}
   labels:
   {{- include "zoo.labels" . | nindent 4 }}
   {{- with $zoo.labels }}
@@ -75,7 +74,7 @@ spec:
         {{- $zooName := include "zoo.name" . }}
         {{- $zooReplicas := int $zoo.replicas  }}
         {{- $zooHeadless := printf "%s-%s" $zooName "headless" | trunc 63 }}
-        {{- $zooNamespace := include "admin.namespace" . }}
+        {{- $zooNamespace := .Release.Namespace }}
         {{- $zooDomain := $zoo.clusterDomain }}
         - name: ZOO_SERVERS
           value: {{ range $k, $v := until $zooReplicas }}{{ $zooName }}-{{ $v 
}}.{{ $zooName }}.{{ $zooNamespace }}.svc.{{ $zooDomain }}:2888:3888::{{ add $v 
1 }} {{ end }}
@@ -157,5 +156,4 @@ spec:
           name: {{ template "zoo.name" . }}-scripts
           defaultMode: 0755
       - name: data
-        emptyDir: {}
-{{- end -}}
\ No newline at end of file
+        emptyDir: {}
\ No newline at end of file
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/zzz_profile.yaml
 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/zzz_profile.yaml
new file mode 100644
index 00000000..32c3348c
--- /dev/null
+++ 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/templates/zzz_profile.yaml
@@ -0,0 +1,19 @@
+{{- if $.Values.defaults}}
+{{ fail (cat
+  "`--set defaults.foo=bar` with `--set foo=bar`. Defaults set:\n"
+  ($.Values.defaults | toYaml |nindent 4) ) }}
+{{- end }}
+{{- $defaults := $.Values._internal_default_values_not_set }}
+{{- $_ := unset $.Values "_internal_default_values_not_set " }}
+{{- $profile := dict }}
+{{- with (coalesce ($.Values).profile ($.Values.global).profile) }}
+{{- with $.Files.Get (printf "files/profile-%s.yaml" .)}}
+{{- $profile = (. | fromYaml) }}
+{{- else }}
+{{ fail (cat "unknown profile" .) }}
+{{- end }}
+{{- end }}
+{{- if false }}
+{{- $a := mustMergeOverwrite $defaults ($profile.global) ($.Values.global | 
default dict)  }}
+{{- end }}
+{{- $b := set $ "Values" (mustMergeOverwrite $defaults $.Values) }}
diff --git 
a/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml 
b/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
index a913fe5c..bda5bdfc 100644
--- a/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
+++ b/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
@@ -1,9 +1,21 @@
+# 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.
+
 _internal_default_values_not_set:
   global:
     dubboNamespace: dubbo-system
-zookeeper:
-  ## Whether to enable the zookeeper.
-  enabled: false
   ## Override the namespace where the resource is deployed.
   namespaceOverride: ~
   ## Labels to attach to the resource.
diff --git a/manifests/profiles/empty.yaml b/manifests/profiles/empty.yaml
index 5230fb81..0ffc38b4 100644
--- a/manifests/profiles/empty.yaml
+++ b/manifests/profiles/empty.yaml
@@ -22,7 +22,7 @@ spec:
       enabled: false
     register:
       nacos:
-        enabled: true
+        enabled: false
       zookeeper:
         enabled: false
   dashboard:
diff --git a/operator/pkg/component/component.go 
b/operator/pkg/component/component.go
index 71f8ba56..64aa48dc 100644
--- a/operator/pkg/component/component.go
+++ b/operator/pkg/component/component.go
@@ -56,7 +56,7 @@ var AllComponents = []Component{
                SpecName:           "zookeeper",
                ResourceType:       "StatefulSet",
                ResourceName:       "register",
-               Default:            true,
+               Default:            false,
                HelmSubDir:         
"dubbo-control/register-discovery/zookeeper",
                HelmValuesTreeRoot: "zookeeper",
        },
@@ -64,9 +64,10 @@ var AllComponents = []Component{
 
 var (
        userFacingCompNames = map[Name]string{
-               BaseComponentName:          "Dubbo Core",
-               AdminComponentName:         "Dubbo Dashboard",
-               NacosRegisterComponentName: "Dubbo Nacos Register Plane",
+               BaseComponentName:              "Dubbo Resource Core",
+               AdminComponentName:             "Dubbo Admin Dashboard",
+               NacosRegisterComponentName:     "Dubbo Nacos Register Plane",
+               ZookeeperRegisterComponentName: "Dubbo Zookeeper Register 
Plane",
        }
 
        Icons = map[Name]string{
diff --git a/operator/pkg/install/installer.go 
b/operator/pkg/install/installer.go
index 314a07ee..673cf0d5 100644
--- a/operator/pkg/install/installer.go
+++ b/operator/pkg/install/installer.go
@@ -218,9 +218,11 @@ func (i Installer) prune(manifests []manifest.ManifestSet) 
error {
 }
 
 var componentDependencies = map[component.Name][]component.Name{
-       component.NacosRegisterComponentName: {},
+       component.NacosRegisterComponentName:     {},
+       component.ZookeeperRegisterComponentName: {},
        component.BaseComponentName: {
                component.NacosRegisterComponentName,
+               component.ZookeeperRegisterComponentName,
                component.AdminComponentName,
        },
        component.AdminComponentName: {},

Reply via email to