You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2025/02/24 02:56:25 UTC

(dubbo-kubernetes) branch master updated: [charts] add kube prometheus dependencies (#622)

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 cb251449 [charts] add kube prometheus dependencies (#622)
cb251449 is described below

commit cb2514498a2558eda0a6b99eeb6981ee072cd5c7
Author: Jian Zhong <11...@qq.com>
AuthorDate: Mon Feb 24 10:56:20 2025 +0800

    [charts] add kube prometheus dependencies (#622)
---
 manifests/charts/admin/Chart.lock                   |   6 ++++++
 manifests/charts/admin/Chart.yaml                   |   4 ++++
 .../admin/charts/kube-prometheus-stack-65.2.0.tgz   | Bin 0 -> 591234 bytes
 manifests/charts/admin/templates/_helpers.tpl       |  18 ------------------
 manifests/charts/admin/templates/certificates.yaml  |   2 ++
 manifests/charts/admin/templates/configmap.yaml     |  20 ++++++++++----------
 manifests/charts/admin/templates/job.yaml           |   4 +++-
 manifests/charts/admin/templates/service.yaml       |   4 ++--
 .../nacos/templates/configmap.yaml                  |   4 ++--
 .../nacos/templates/statefulset.yaml                |   2 +-
 .../register-discovery/zookeeper/values.yaml        |   6 +++---
 11 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/manifests/charts/admin/Chart.lock b/manifests/charts/admin/Chart.lock
new file mode 100644
index 00000000..46c24bc1
--- /dev/null
+++ b/manifests/charts/admin/Chart.lock
@@ -0,0 +1,6 @@
+dependencies:
+- name: kube-prometheus-stack
+  repository: https://prometheus-community.github.io/helm-charts
+  version: 65.2.0
+digest: sha256:0e754f126dbd161d06feac3e7c9e0440481703ad752c3cc7856637de714970c9
+generated: "2025-02-24T10:38:39.357413157+08:00"
diff --git a/manifests/charts/admin/Chart.yaml b/manifests/charts/admin/Chart.yaml
index 22a62398..7a3bc673 100644
--- a/manifests/charts/admin/Chart.yaml
+++ b/manifests/charts/admin/Chart.yaml
@@ -21,6 +21,10 @@ home: https://github.com/apache/dubbo-kubernetes
 description: Helm chart for dubbo admin dashboard.
 version: 1.0.0
 appVersion: 1.0.0
+dependencies:
+  - name: kube-prometheus-stack
+    version: "65.2.0"
+    repository: "https://prometheus-community.github.io/helm-charts"
 maintainers:
   - name: mfordjody
     email: zhongxjian@apache.org
diff --git a/manifests/charts/admin/charts/kube-prometheus-stack-65.2.0.tgz b/manifests/charts/admin/charts/kube-prometheus-stack-65.2.0.tgz
new file mode 100644
index 00000000..9f39d06d
Binary files /dev/null and b/manifests/charts/admin/charts/kube-prometheus-stack-65.2.0.tgz differ
diff --git a/manifests/charts/admin/templates/_helpers.tpl b/manifests/charts/admin/templates/_helpers.tpl
index 7c593a2a..85373392 100644
--- a/manifests/charts/admin/templates/_helpers.tpl
+++ b/manifests/charts/admin/templates/_helpers.tpl
@@ -240,24 +240,6 @@ Return Nacos Port to use.
 {{- printf "3000" -}}
 {{- end -}}
 
-{{/*
-Return jobs-1 annotations to use.
-*/}}
-{{- define "jobs.1.annotations" -}}
-"helm.sh/hook": "pre-install"
-"helm.sh/hook-weight": "1"
-"helm.sh/hook-delete-policy": "hook-succeeded"
-{{- end -}}
-
-{{/*
-Return jobs-2 annotations to use.
-*/}}
-{{- define "jobs.2.annotations" -}}
-"helm.sh/hook": "pre-install"
-"helm.sh/hook-weight": "2"
-"helm.sh/hook-delete-policy": "hook-succeeded"
-{{- end -}}
-
 {{/*
 Return jobs serviceAccount annotations to use.
 */}}
diff --git a/manifests/charts/admin/templates/certificates.yaml b/manifests/charts/admin/templates/certificates.yaml
index 79216d27..7e3511e2 100644
--- a/manifests/charts/admin/templates/certificates.yaml
+++ b/manifests/charts/admin/templates/certificates.yaml
@@ -34,6 +34,7 @@ We only autogenerate certs if the cert is not yet generated. This way we keep th
   {{ $caBundle = $ca.Cert | b64enc }}
 {{- end -}}
 ---
+{{- if .Values.cp.enabled }}
 apiVersion: v1
 kind: Secret
 metadata:
@@ -46,3 +47,4 @@ data:
   tls.key: {{ $key }}
   ca.crt: {{ $caBundle }}
 {{- end }}
+{{- end }}
diff --git a/manifests/charts/admin/templates/configmap.yaml b/manifests/charts/admin/templates/configmap.yaml
index 5ef88aed..0b921a8f 100644
--- a/manifests/charts/admin/templates/configmap.yaml
+++ b/manifests/charts/admin/templates/configmap.yaml
@@ -33,18 +33,18 @@ data:
     #!/bin/bash
      set -eux
     {{- if (eq $prom.enabled true) }}
-     PROMETHEUS="https://prometheus-community.github.io/helm-charts"
+{{/*     PROMETHEUS="https://prometheus-community.github.io/helm-charts"*/}}
 
-     helm pull {{ include "prom.stack.name" . }} --repo "$PROMETHEUS" --version {{ $prom.image.tag }} --untar && \
+{{/*     helm pull {{ include "prom.stack.name" . }} --repo "$PROMETHEUS" --version {{ $prom.image.tag }} --untar && \*/}}
 
-     for i in {1..5}; do
-     if rm -rf "{{ include "prom.stack.name" . }}-{{ $prom.image.tag }}.tgz"; then
-     break
-     else
-     echo "Attempt $i: Failed to remove directory, retrying in 2 seconds..."
-     sleep 2
-     fi
-     done
+{{/*     for i in {1..5}; do*/}}
+{{/*     if rm -rf "{{ include "prom.stack.name" . }}-{{ $prom.image.tag }}.tgz"; then*/}}
+{{/*     break*/}}
+{{/*     else*/}}
+{{/*     echo "Attempt $i: Failed to remove directory, retrying in 2 seconds..."*/}}
+{{/*     sleep 2*/}}
+{{/*     fi*/}}
+{{/*     done*/}}
      cp -r "/files/resources/dubbo-metrics.yaml" "{{ include "prom.stack.name" . }}/templates/{{ include "grafana.name" . }}/dashboards-{{ $prom.dashboardsVersion }}"
      ls -la "{{ include "prom.stack.name" . }}/templates/{{ include "grafana.name" . }}/dashboards-{{ $prom.dashboardsVersion }}"
 
diff --git a/manifests/charts/admin/templates/job.yaml b/manifests/charts/admin/templates/job.yaml
index 85e20cf3..a51afd22 100644
--- a/manifests/charts/admin/templates/job.yaml
+++ b/manifests/charts/admin/templates/job.yaml
@@ -7,7 +7,9 @@ metadata:
   labels:
   {{- include "jobs.labels" . | nindent 4 }}
   annotations:
-  {{- include "jobs.2.annotations" . | nindent 4 }}
+    "helm.sh/hook": "pre-install"
+    "helm.sh/hook-weight": "2"
+    "helm.sh/hook-delete-policy": "hook-succeeded"
 spec:
   template:
     metadata:
diff --git a/manifests/charts/admin/templates/service.yaml b/manifests/charts/admin/templates/service.yaml
index 23c09eb7..f3fb5fc5 100644
--- a/manifests/charts/admin/templates/service.yaml
+++ b/manifests/charts/admin/templates/service.yaml
@@ -38,9 +38,9 @@ spec:
     port: 8888
     targetPort: admin-http
     appProtocol: TCP
-  - name: admin-xds-grpc
+  - name: admin-grpc
     port: 5678
-    targetPort: admin-xds-grpc
+    targetPort: admin-grpc
   selector:
     app: {{ template "admin.selector" . }}
 {{- 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 7d7b377d..def698e4 100644
--- a/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
+++ b/manifests/charts/dubbo-control/register-discovery/nacos/templates/configmap.yaml
@@ -1,5 +1,5 @@
 {{- $nacos := .Values -}}
-{{/*{{- if $nacos.storage.type "mysql" }}*/}}
+{{- if $nacos.storage.type "mysql" }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
@@ -22,5 +22,5 @@ data:
   mysql.user: {{ .db.username }}
   mysql.password: {{ .db.password }}
   mysql.param: {{ .db.param | default "characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false" }}
-{{/*{{- end -}}*/}}
+{{- 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 2c22a826..a8a85e3f 100644
--- a/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
+++ b/manifests/charts/dubbo-control/register-discovery/nacos/templates/statefulset.yaml
@@ -1,5 +1,5 @@
 {{- $nacos := .Values -}}
-apiVersion: {{ template "apiVersion" . }}
+apiVersion: apps/v1
 kind: StatefulSet
 metadata:
   name: {{ template "nacos.name" . }}
diff --git a/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml b/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
index bda5bdfc..ee309742 100644
--- a/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
+++ b/manifests/charts/dubbo-control/register-discovery/zookeeper/values.yaml
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 _internal_default_values_not_set:
-  global:
-    dubboNamespace: dubbo-system
   ## Override the namespace where the resource is deployed.
   namespaceOverride: ~
   ## Labels to attach to the resource.
@@ -185,4 +183,6 @@ _internal_default_values_not_set:
       # auth.quorum.serverPasswords Comma, semicolon or whitespace separated list of passwords to assign to users when created.
       serverPasswords: ""
       # auth.quorum.existingSecret Use existing secret (ignores previous passwords).
-      existingSecret: ""
\ No newline at end of file
+      existingSecret: ""
+  global:
+    dubboNamespace: dubbo-system
\ No newline at end of file