add dubbo-admin nacos (#972)
diff --git a/deploy/charts/dubbo-admin/templates/NOTES.txt b/deploy/charts/dubbo-admin/templates/NOTES.txt
index 2320a48..b22cf41 100644
--- a/deploy/charts/dubbo-admin/templates/NOTES.txt
+++ b/deploy/charts/dubbo-admin/templates/NOTES.txt
@@ -3,34 +3,16 @@
VERSION: {{ .Chart.Name }}:{{ .Chart.AppVersion }}
====================================================
{{- if .Values.zookeeper.enabled }}
-Registration Center:{{ .Values.zookeeper.zoo_name }}
-VERSION: {{ .Values.zookeeper.zoo_name }}:{{ .Values.image.zoo_tag }}
+Registration Center:{{ .Values.zookeeper.name }}
+VERSION: {{ .Values.zookeeper.name }}:{{ .Values.zookeeper.image.tag }}
+{{- end }}
+{{- if .Values.nacos.enabled }}
+Registration Center:{{ .Values.nacos.name }}
+VERSION: {{ .Values.nacos.name }}:{{ .Values.nacos.image.tag }}
{{- end }}
====================================================
-1. Get your '{{ .Chart.Name }}' by running:
-
- kubectl get deploy {{ include "dubbo-admin.fullname" . }} -n {{ include "dubbo-admin.namespace" . }}
-
-2. Login Dubbo-admin default user and password:
- **********************************************
- USERNAME: root
- PASSWORD: root
- **********************************************
-
-3. The Dubbo-admin server can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster:
-
- {{ include "dubbo-admin.fullname" . }}.{{ include "dubbo-admin.namespace" . }}.svc.cluster.local
-
- {{ if .Values.ingress.enabled }}
- If you bind Dubbo-admin to 38080, please update values in values.yaml and reinstall:
-
- From outside the cluster, the server URL(s) are:
- {{- range .Values.ingress.hosts }}
- http://{{ . }}
- {{- end }}
- {{- else }}
-4. Get the Dubbo-admin URL to visit by running these commands in the same shell:
+ Get the Dubbo-admin URL to visit by running these commands in the same shell:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ include "dubbo-admin.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dubbo-admin.fullname" . }})
@@ -50,7 +32,22 @@
kubectl --namespace {{ include "dubbo-admin.namespace" . }} port-forward $POD_NAME 38080
{{- end }}
-{{- end }}
+
+ Login Dubbo-admin default user and password
+ **********************************************
+ {{ .Chart.Name }}-username: root
+ {{ .Chart.Name }}-password: root
+ **********************************************
+
+
+ {{ if .Values.ingress.enabled }}
+ If you bind Dubbo-admin to 38080, please update values in values.yaml and reinstall:
+
+ From outside the cluster, the server URL(s) are:
+ {{- range .Values.ingress.hosts }}
+ http://{{ . }}
+ {{- end }}
+ {{- else }}
{{- if not .Values.persistence.enabled }}
@@ -58,4 +55,5 @@
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Dubbo-admin pod is terminated. #####
#################################################################################
+{{- end }}
{{- end }}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-configmap.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-configmap.yaml
new file mode 100644
index 0000000..027cb94
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-configmap.yaml
@@ -0,0 +1,18 @@
+{{- if .Values.nacos.enabled }}
+{{- if eq .Values.nacos.storage.type "mysql"}}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ template "nacos.fullname" . }}-configmap
+ namespace: {{ template "nacos.namespace" . }}
+data:
+ {{- with .Values.nacos.storage.db }}
+ mysql.db.host: {{ .host }}
+ mysql.db.name: {{ .name }}
+ mysql.port: "{{ .port | default 3306 }}"
+ mysql.user: {{ .username }}
+ mysql.password: {{ .password }}
+ mysql.param: {{ .param | default "characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false" }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-networkpolicy.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-networkpolicy.yaml
new file mode 100644
index 0000000..c2adfb5
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-networkpolicy.yaml
@@ -0,0 +1,29 @@
+{{- if .Values.networkPolicy.enabled }}
+kind: NetworkPolicy
+apiVersion: {{ include "nacos.networkPolicy.apiVersion" . }}
+metadata:
+ name: {{ include "nacos.fullname" . }}
+ namespace: {{ template "nacos.namespace" . }}
+ labels: {{- include "nacos.labels" . | nindent 4 }}
+spec:
+ podSelector:
+ matchLabels: {{- include "nacos.matchLabels" . | nindent 6 }}
+ policyTypes:
+ - Ingress
+ ingress:
+ - ports:
+ - port: {{ .Values.nacos.service.port }}
+ {{- if not .Values.networkPolicy.allowExternal }}
+ from:
+ - podSelector:
+ matchLabels:
+ {{ include "zookeeper.fullname" . }}-client: "true"
+ - podSelector:
+ matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
+ {{- end }}
+ - ports:
+ - port: {{ .Values.nacos.service.port }}
+ from:
+ - podSelector:
+ matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
+{{- end }}
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-pdb.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-pdb.yaml
new file mode 100644
index 0000000..869906b
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-pdb.yaml
@@ -0,0 +1,18 @@
+{{- $replica := int .Values.replicas }}
+{{- if and .Values.podDisruptionBudget.enabled (gt $replica 1) }}
+apiVersion: {{ include "nacos.policy.apiVersion" . }}
+kind: PodDisruptionBudget
+metadata:
+ name: {{ template "nacos.fullname" . }}
+ namespace: {{ template "nacos.namespace" . }}
+ labels: {{- include "nacos.labels" . | nindent 4 }}
+spec:
+ {{- if .Values.podDisruptionBudget.minAvailable }}
+ minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
+ {{- end }}
+ {{- if .Values.podDisruptionBudget.maxUnavailable }}
+ maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
+ {{- end }}
+ selector:
+ matchLabels: {{- include "nacos.matchLabels" . | nindent 6 }}
+{{- end }}
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-statefulset.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-statefulset.yaml
new file mode 100644
index 0000000..420cff8
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-statefulset.yaml
@@ -0,0 +1,157 @@
+{{- if .Values.nacos.enabled }}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ template "nacos.fullname" . }}
+ namespace: {{ template "nacos.namespace" . }}
+spec:
+ replicas: {{ .Values.replicas }}
+ {{- if eq .Values.global.mode "cluster" }}
+ serviceName: nacos-headless
+ {{- else }}
+ serviceName: nacos
+ {{- end }}
+ selector:
+ matchLabels: {{- include "nacos.matchLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/name: nacos
+ spec:
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- if and (eq .Values.nacos.mode "cluster") (.Values.nacos.plugin.enable) }}
+ initContainers:
+ - name: peer-finder-plugin-install
+ image: {{.Values.nacos.plugin.image.repository}}:{{.Values.nacos.plugin.image.tag}}
+ imagePullPolicy: {{ .Values.nacos.plugin.image.pullPolicy }}
+ volumeMounts:
+ - mountPath: /home/nacos/plugins/peer-finder
+ name: data
+ subPath: peer-finder
+ {{- end }}
+ containers:
+ - name: nacos
+ image: "{{ .Values.nacos.image.repository }}:{{ .Values.nacos.image.tag }}"
+ imagePullPolicy: {{ .Values.nacos.image.pullPolicy }}
+ startupProbe:
+ initialDelaySeconds: 180
+ periodSeconds: 5
+ timeoutSeconds: 10
+ httpGet:
+ scheme: HTTP
+ port: {{ .Values.nacos.service.port }}
+ path: /nacos/v1/console/health/readiness
+ livenessProbe:
+ initialDelaySeconds: 10
+ periodSeconds: 5
+ timeoutSeconds: 10
+ httpGet:
+ scheme: HTTP
+ port: {{ .Values.nacos.service.port }}
+ path: /nacos/v1/console/health/liveness
+ ports:
+ - name: http
+ containerPort: {{ .Values.nacos.service.port }}
+ protocol: TCP
+ - containerPort: {{ add .Values.nacos.service.port 1000 }}
+ name: client-rpc
+ - containerPort: {{ add .Values.nacos.service.port 1001 }}
+ name: raft-rpc
+ - containerPort: 7848
+ name: old-raft-rpc
+ resources:
+ {{- toYaml .Values.resources | nindent 12 }}
+ env:
+ - name: NACOS_SERVER_PORT
+ value: {{ .Values.nacos.service.port | quote }}
+ - name: NACOS_APPLICATION_PORT
+ value: {{ .Values.nacos.service.port | quote }}
+ - name: PREFER_HOST_MODE
+ value: {{ .Values.nacos.service.port | quote }}
+ {{- if eq .Values.nacos.mode "standalone" }}
+ - name: MODE
+ value: "standalone"
+
+ {{- else if eq .Values.nacos.mode "cluster" }}
+ - name: SERVICE_NAME
+ value: "nacos-hs"
+ - name: DOMAIN_NAME
+ value: {{ .Values.nacos.domainName | quote }}
+ - name: POD_NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ {{- end }}
+ {{- if eq .Values.nacos.storage.type "mysql" }}
+ - name: SPRING_DATASOURCE_PLATFORM
+ value: "mysql"
+ - name: MYSQL_SERVICE_HOST
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.db.host
+ - name: MYSQL_SERVICE_DB_NAME
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.db.name
+ - name: MYSQL_SERVICE_PORT
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.port
+ - name: MYSQL_SERVICE_USER
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.user
+ - name: MYSQL_SERVICE_PASSWORD
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.password
+ - name: MYSQL_SERVICE_DB_PARAM
+ valueFrom:
+ configMapKeyRef:
+ name: nacos-cm
+ key: mysql.param
+ {{- else }}
+ - name: EMBEDDED_STORAGE
+ value: embedded
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /home/nacos/plugins/peer-finder
+ subPath: peer-finder
+ - name: data
+ mountPath: /home/nacos/data
+ subPath: data
+ - name: data
+ mountPath: /home/nacos/logs
+ subPath: logs
+ {{- if not .Values.persistence.enabled }}
+ volumes:
+ - name: data
+ emptyDir: {}
+ {{- end }}
+ {{- if .Values.persistence.enabled }}
+ volumeClaimTemplates:
+ - metadata:
+ name: data
+ spec:
+ {{- toYaml .Values.nacos.persistence.data | nindent 8 }}
+ {{- end }}
+ {{- end }}
+
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc-headless.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc-headless.yaml
new file mode 100644
index 0000000..4d66c4a
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc-headless.yaml
@@ -0,0 +1,28 @@
+{{- if .Values.nacos.enabled }}
+{{- if and (eq .Values.nacos.mode "cluster") }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "nacos.fullname" . }}-headless
+ namespace: {{ template "nacos.namespace" }}
+ labels: {{- include "nacos.labels" . | nindent 4 }}
+spec:
+ clusterIP: None
+ ports:
+ - port: {{ .Values.nacos.service.port }}
+ targetPort: {{ .Values.nacos.service.port }}
+ protocol: TCP
+ name: http
+ - port: {{ add .Values.nacos.service.port 1000 }}
+ name: client-rpc
+ targetPort: {{ add .Values.nacos.service.port 1000 }}
+ - port: {{add .Values.nacos.service.port 1001}}
+ name: raft-rpc
+ targetPort: {{ add .Values.nacos.service.port 1001 }}
+ - port: 7848
+ name: old-raft-rpc
+ targetPort: 7848
+ protocol: TCP
+ selector: {{- include "nacos.matchLabels" . | nindent 4 }}
+ {{- end }}
+ {{- end }}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc.yaml b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc.yaml
new file mode 100644
index 0000000..75ac3ef
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/admin-nacos/admin-nacos-svc.yaml
@@ -0,0 +1,29 @@
+{{- if .Values.nacos.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "nacos.fullname" . }}
+ namespace: {{ template "nacos.namespace" . }}
+ labels: {{- include "nacos.labels" . | nindent 4 }}
+spec:
+ type: {{ .Values.nacos.service.type }}
+ ports:
+ - port: {{ .Values.nacos.service.port }}
+ targetPort: {{ .Values.nacos.service.port }}
+ protocol: TCP
+ name: http
+ - port: {{ add .Values.nacos.service.port 1000 }}
+ name: client-rpc
+ targetPort: {{add .Values.nacos.service.port 1000 }}
+ - port: {{add .Values.nacos.service.port 1001 }}
+ name: raft-rpc
+ targetPort: {{add .Values.nacos.service.port 1001 }}
+ - port: 7848
+ name: old-raft-rpc
+ targetPort: 7848
+ protocol: TCP
+ {{- if eq .Values.nacos.service.type "NodePort" }}
+ nodePort: {{ .Values.nacos.service.nodePort }}
+ {{- end }}
+ selector: {{- include "nacos.matchLabels" . | nindent 4 }}
+ {{- end }}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-networkpolicy.yaml b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-networkpolicy.yaml
index 8b302e3..7b48c66 100644
--- a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-networkpolicy.yaml
+++ b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-networkpolicy.yaml
@@ -5,11 +5,11 @@
name: {{ include "zookeeper.fullname" . }}
namespace: {{ template "zookeeper.namespace" . }}
labels: {{- include "zookeeper.labels" . | nindent 4 }}
- {{- if .Values.commonLabels }}
- {{- include "zookeeper.tplvalues" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- if .Values.Labels }}
+ {{- include "zookeeper.tplvalues" ( dict "value" .Values.Labels "context" $ ) | nindent 4 }}
{{- end }}
- {{- if .Values.commonAnnotations }}
- annotations: {{- include "zookeeper.tplvalues" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- if .Values.Annotations }}
+ annotations: {{- include "zookeeper.tplvalues" ( dict "value" .Values.Annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
podSelector:
@@ -20,9 +20,6 @@
# Allow inbound connections to ZooKeeper
- ports:
- port: {{ .Values.containerPorts.client }}
- {{- if .Values.metrics.enabled }}
- - port: {{ .Values.metrics.containerPort }}
- {{- end }}
{{- if not .Values.networkPolicy.allowExternal }}
from:
- podSelector:
diff --git a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-pdb.yaml b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-pdb.yaml
index efd42c1..c3d799e 100644
--- a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-pdb.yaml
+++ b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-pdb.yaml
@@ -7,11 +7,11 @@
namespace: {{ template "zookeeper.namespace" . }}
labels: {{- include "zookeeper.labels" . | nindent 4 }}
app.kubernetes.io/component: zookeeper
- {{- if .Values.commonLabels }}
- {{- include "zookeeper.tplvalues" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- if .Values.Labels }}
+ {{- include "zookeeper.tplvalues" ( dict "value" .Values.Labels "context" $ ) | nindent 4 }}
{{- end }}
- {{- if .Values.commonAnnotations }}
- annotations: {{- include "zookeeper.tplvalues" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- if .Values.Annotations }}
+ annotations: {{- include "zookeeper.tplvalues" ( dict "value" .Values.Annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
diff --git a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-statefulset.yaml b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-statefulset.yaml
index 038c728..67da933 100644
--- a/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-statefulset.yaml
+++ b/deploy/charts/dubbo-admin/templates/admin-zookeeper/admin-zk-statefulset.yaml
@@ -16,8 +16,8 @@
spec:
containers:
- name: zookeeper
- image: {{ .Values.image.zoo_repository }}:{{ .Values.image.zoo_tag }}
- imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
+ image: {{ .Values.zookeeper.image.repository }}:{{ .Values.zookeeper.image.tag }}
+ imagePullPolicy: {{ .Values.zookeeper.image.pullPolicy | quote }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_charts.tpl b/deploy/charts/dubbo-admin/templates/tpl/_charts.tpl
index 376e671..8270792 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_charts.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_charts.tpl
@@ -11,4 +11,12 @@
*/}}
{{- define "zookeeper.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "nacos.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_helpers.tpl b/deploy/charts/dubbo-admin/templates/tpl/_helpers.tpl
index 183f1ca..b230a99 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_helpers.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_helpers.tpl
@@ -36,12 +36,38 @@
{{/*
-Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
+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.nacos.name -}}
+{{- .Values.nacos.name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Values.nacos.name -}}
+{{- if contains $name .Release.Name -}}
+{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+
+{{/*
+Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "zookeeper.matchLabels" -}}
app.kubernetes.io/name: {{ include "zookeeper.name" . }}
{{- end -}}
+{{/*
+Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
+*/}}
+{{- define "nacos.matchLabels" -}}
+app.kubernetes.io/name: {{ include "nacos.name" . }}
+{{- end -}}
+
{{- define "dubbo-admin.selectorLabels" -}}
app.kubernetes.io/name: {{ include "dubbo-admin.name" . }}
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_labels.tpl b/deploy/charts/dubbo-admin/templates/tpl/_labels.tpl
index d716807..6739dd9 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_labels.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_labels.tpl
@@ -13,4 +13,12 @@
helm.sh/chart: {{ include "zookeeper.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+
+{{- define "nacos.labels" -}}
+app.kubernetes.io/name: {{ include "nacos.name" . }}
+helm.sh/chart: {{ include "nacos.chart" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_names.tpl b/deploy/charts/dubbo-admin/templates/tpl/_names.tpl
index 2893e3e..cdfddce 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_names.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_names.tpl
@@ -12,5 +12,14 @@
Expand the name of the chart.
*/}}
{{- define "zookeeper.name" -}}
-{{- default .Values.zookeeper.zoo_name | trunc 63 | trimSuffix "-" -}}
+{{- default .Values.zookeeper.name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "nacos.name" -}}
+{{- default .Values.nacos.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_namespaces.tpl b/deploy/charts/dubbo-admin/templates/tpl/_namespaces.tpl
index 7a18a9c..cfc7e2b 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_namespaces.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_namespaces.tpl
@@ -19,4 +19,16 @@
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
+{{- end -}}
+
+
+{{/*
+Nacos Namespace to use
+*/}}
+{{- define "nacos.namespace" -}}
+{{- if .Values.namespaceOverride -}}
+ {{- .Values.namespaceOverride -}}
+{{- else -}}
+ {{- .Release.Namespace -}}
+{{- end -}}
{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/tpl/_versions.tpl b/deploy/charts/dubbo-admin/templates/tpl/_versions.tpl
index bf19c10..c37a573 100644
--- a/deploy/charts/dubbo-admin/templates/tpl/_versions.tpl
+++ b/deploy/charts/dubbo-admin/templates/tpl/_versions.tpl
@@ -58,6 +58,20 @@
{{/*
+Return the target Kubernetes version
+*/}}
+{{- define "nacos.kubeVersion" -}}
+{{- if .Values.global }}
+ {{- if .Values.global.kubeVersion }}
+ {{- .Values.global.kubeVersion -}}
+ {{- else }}
+ {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+ {{- end -}}
+{{- else }}
+{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+{{- end -}}
+{{- end -}}
+{{/*
Return the appropriate apiVersion for statefulset.
*/}}
{{- define "zookeeper.statefulset.apiVersion" -}}
@@ -79,6 +93,18 @@
{{- end -}}
{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for networkpolicy.
+*/}}
+{{- define "nacos.networkPolicy.apiVersion" -}}
+{{- if semverCompare "<1.7-0" (include "nacos.kubeVersion" .) -}}
+{{- print "extensions/v1beta1" -}}
+{{- else -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
{{/*
Return the appropriate apiVersion for poddisruptionbudget.
*/}}
@@ -91,4 +117,16 @@
{{- end -}}
+{{/*
+Return the appropriate apiVersion for poddisruptionbudget.
+*/}}
+{{- define "nacos.policy.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "nacos.kubeVersion" .) -}}
+{{- print "policy/v1beta1" -}}
+{{- else -}}
+{{- print "policy/v1" -}}
+{{- end -}}
+{{- end -}}
+
+
diff --git a/deploy/charts/dubbo-admin/values.yaml b/deploy/charts/dubbo-admin/values.yaml
index 1c5e5d2..ff07b6a 100644
--- a/deploy/charts/dubbo-admin/values.yaml
+++ b/deploy/charts/dubbo-admin/values.yaml
@@ -39,6 +39,7 @@
imagePullSecrets: []
+
rbac:
enabled: true
# Use an existing ClusterRole/Role (depending on rbac.namespaced false/true)
@@ -103,60 +104,59 @@
## @param readinessProbe.enabled Enable readinessProbe on containers
-## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
-## @param readinessProbe.periodSeconds Period seconds for readinessProbe
-## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
-## @param readinessProbe.failureThreshold Failure threshold for readinessProbe
-## @param readinessProbe.successThreshold Success threshold for readinessProbe
-## @param readinessProbe.probeCommandTimeout Probe command timeout for readinessProbe
-##
readinessProbe:
httpGet:
path: /
port: 8080
+ ## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
initialDelaySeconds: 60
+ ## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
timeoutSeconds: 30
+ ## @param readinessProbe.periodSeconds Period seconds for readinessProbe
periodSeconds: 10
+ ## @param readinessProbe.successThreshold Success threshold for readinessProbe
successThreshold: 1
+ ## @param readinessProbe.failureThreshold Failure threshold for readinessProbe
failureThreshold: 3
+ ## @param readinessProbe.probeCommandTimeout Probe command timeout for readinessProbe
probeCommandTimeout: 1
-## @param livenessProbe.enabled Enable livenessProbe on containers
-## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
-## @param livenessProbe.periodSeconds Period seconds for livenessProbe
-## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
-## @param livenessProbe.failureThreshold Failure threshold for livenessProbe
-## @param livenessProbe.successThreshold Success threshold for livenessProbe
-## @param livenessProbe.probeCommandTimeout Probe command timeout for livenessProbe
##
+## @param livenessProbe.enabled Enable livenessProbe on containers
livenessProbe:
httpGet:
path: /
port: 8080
+ ## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
initialDelaySeconds: 60
+ ## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
timeoutSeconds: 30
+ ## @param livenessProbe.periodSeconds Period seconds for livenessProbe
periodSeconds: 10
+ ## @param livenessProbe.successThreshold Success threshold for livenessProbe
successThreshold: 1
+ ## @param livenessProbe.failureThreshold Failure threshold for livenessProbe
failureThreshold: 3
+ ## @param livenessProbe.probeCommandTimeout Probe command timeout for livenessProbe
probeCommandTimeout: 1
+
## @param startupProbe.enabled Enable startupProbe on containers
-## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
-## @param startupProbe.periodSeconds Period seconds for startupProbe
-## @param startupProbe.timeoutSeconds Timeout seconds for startupProbe
-## @param startupProbe.failureThreshold Failure threshold for startupProbe
-## @param startupProbe.successThreshold Success threshold for startupProbe
-##
startupProbe:
httpGet:
path: /
port: 8080
+ ## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
initialDelaySeconds: 60
+ ## @param startupProbe.timeoutSeconds Timeout seconds for startupProbe
timeoutSeconds: 30
+ ## @param startupProbe.periodSeconds Period seconds for startupProbe
periodSeconds: 10
+ ## @param startupProbe.successThreshold Success threshold for startupProbe
successThreshold: 1
+ ## @param startupProbe.failureThreshold Failure threshold for startupProbe
failureThreshold: 3
@@ -164,21 +164,12 @@
image:
registry: docker.io
## e.g registry.k8s.io
- ## e.g k8s.gcr.io
+ ##
##
repository: apache/dubbo-admin
##
##
tag: "0.5.0"
- ## version
- ##
- zoo_repository: bitnami/zookeeper
- ##
- ##
- zoo_tag: 3.8.1-debian-11-r0
- ## zookeeper version
- ##
- digest: ""
##
##
debug: false
@@ -451,6 +442,15 @@
# memory: 128Mi
+extraresources: {}
+# limits:
+# cpu: 100m
+# memory: 128Mi
+# requests:
+# cpu: 100m
+# memory: 128Mi
+
+
## Node labels for pod assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
#
@@ -571,6 +571,7 @@
# requests:
# cpu: 100m
# memory: 128Mi
+
securityContext:
runAsNonRoot: false
runAsUser: 0
@@ -645,14 +646,24 @@
## Zookeeper Necessary configuration
zookeeper:
- enabled: true
+ name: zookeeper
##
##
- zoo_name: zookeeper
+ enabled: false
+ ## enabled of false
+ ##
+ ## replicas
+ replicas: 1
## Create a headless service for the deployment
headlessService: false
##
##
+ image:
+ repository: bitnami/zookeeper
+ tag: 3.8.1-debian-11-r0
+ digest: ""
+ debug: false
+ pullPolicy: IfNotPresent
## Create HorizontalPodAutoscaler object for deployment type
autoscaling:
enabled: false
@@ -677,7 +688,6 @@
## zookeeper container Ports
containerPorts:
client: 2181
- tls: 3181
follower: 2888
election: 3888
##
@@ -834,10 +844,10 @@
extraDeploy: []
## @param commonLabels Add labels to all the deployed resources
##
-commonLabels: {}
+Labels: {}
## @param commonAnnotations Add annotations to all the deployed resources
##
-commonAnnotations: {}
+Annotations: {}
## @param namespaceOverride Override namespace for ZooKeeper resources
## Useful when including ZooKeeper as a chart dependency, so it can be released into a different namespace than the parent
##
@@ -854,9 +864,65 @@
args:
- infinity
+
## Nacos Necessary configuration
nacos:
- enabled: false
+ name: nacos
+ ## nacos name
+ ##
+ enabled: true
+ ## true of false
+ ##
+ replicas: 1
+ ## replicas
+ ##
+ mode: standalone
+ # mode: cluster
+ ##
+ ##
+ domainName: cluster.local
+ ##
+ ## image
+ image:
+ registry: docker.io
+ ## e.g registry.k8s.io
+ repository: nacos/nacos-server
+ tag: latest
+ pullPolicy: IfNotPresent
+ ## plugin
+ plugin:
+ enable: true
+ image:
+ repository: nacos/nacos-peer-finder-plugin
+ tag: 1.1
+ pullPolicy: IfNotPresent
+ ## service
+ service:
+ type: NodePort
+ port: 8848
+ nodePort: 30000
+ ## persistence
+ persistence:
+ enabled: false
+ data:
+ accessModes:
+ - ReadWriteOnce
+ storageClassName: ""
+ resources:
+ requests:
+ storage: 5Gi
+ ## storage
+ storage:
+ type: embedded
+# type: mysql
+# db:
+# host: localhost
+# name: nacos
+# port: 3306
+# username: usernmae
+# password: password
+# param: characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false
+
@@ -882,9 +948,9 @@
dubbo.application.logger: slf4j
# nacos config, add parameters to url like username=nacos&password=nacos
- # admin.registry.address: nacos://127.0.0.1:8848?group=DEFAULT_GROUP&namespace=public
- # admin.config-center: nacos://127.0.0.1:8848?group=dubbo
- # admin.metadata-report.address: nacos://127.0.0.1:8848?group=dubbo
+ # admin.registry.address: nacos://nacos:8848?group=DEFAULT_GROUP&namespace=public
+ # admin.config-center: nacos://nacos:8848?group=dubbo
+ # admin.metadata-report.address: nacos://nacos:8848?group=dubbo
# group (Deprecated it is recommended to use URL to add parameters,will be removed in the future)