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 c7023120 [charts] env kube-prometheus import dashboard (#464)
c7023120 is described below
commit c7023120f3c8e74c63fadaf498cb26771d942a4c
Author: mfordjody <[email protected]>
AuthorDate: Tue Oct 15 19:19:07 2024 +0800
[charts] env kube-prometheus import dashboard (#464)
---
.../dashboards/dubbo-metrics.yaml | 0
.../modular => files}/dashboards/dubbo-traces.yaml | 0
manifests/charts/admin/files/env.sh | 20 ++++++++
.../admin/templates/admin/admin-configmap.yaml | 2 +-
.../admin/templates/admin/admin-deployment.yaml | 4 +-
.../admin/templates/admin/admin-statefulset.yaml | 3 ++
.../admin/templates/modular/jobs/jobs-scripts.yaml | 59 ----------------------
.../observable/grafana-resources-app-metrics.yaml | 14 -----
.../observable/grafana-resources-app-traces.yaml | 14 -----
.../observable/grafana-resources-ins-metrics.yaml | 14 -----
.../observable/grafana-resources-ins-traces.yaml | 14 -----
.../observable/grafana-resources-svc-metrics.yaml | 14 -----
.../observable/grafana-resources-svc-traces.yaml | 14 -----
manifests/charts/admin/templates/scripts.yaml | 29 +++++++++++
14 files changed, 54 insertions(+), 147 deletions(-)
diff --git
a/manifests/charts/admin/templates/modular/dashboards/dubbo-metrics.yaml
b/manifests/charts/admin/files/dashboards/dubbo-metrics.yaml
similarity index 100%
rename from
manifests/charts/admin/templates/modular/dashboards/dubbo-metrics.yaml
rename to manifests/charts/admin/files/dashboards/dubbo-metrics.yaml
diff --git
a/manifests/charts/admin/templates/modular/dashboards/dubbo-traces.yaml
b/manifests/charts/admin/files/dashboards/dubbo-traces.yaml
similarity index 100%
rename from
manifests/charts/admin/templates/modular/dashboards/dubbo-traces.yaml
rename to manifests/charts/admin/files/dashboards/dubbo-traces.yaml
diff --git a/manifests/charts/admin/files/env.sh
b/manifests/charts/admin/files/env.sh
new file mode 100644
index 00000000..dfb082fb
--- /dev/null
+++ b/manifests/charts/admin/files/env.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+JAEGER="https://raw.githubusercontent.com/istio/istio/release-1.23/samples/addons/jaeger.yaml"
+PROMETHEUS="https://prometheus-community.github.io/helm-charts"
+ISTIO="https://istio-release.storage.googleapis.com/charts"
+
+helm pull kube-prometheus-stack --repo $PROMETHEUS --version 65.2.0 --untar
+cp -r dashboards/ kube-prometheus-stack/templates/grafana/dashboards-1.14/
+cd kube-prometheus-stack
+helm install kube-prometheus-stack -f values.yaml .
+
+kubectl apply -f $JAEGER
+
+helm repo add istio $ISTIO
+helm repo update
+
+kubectl create namespace istio-system || true
+
+helm install istio-base istio/base -n istio-system --set
defaultRevision=default
+helm install istiod istio/istiod -n istio-system
\ No newline at end of file
diff --git a/manifests/charts/admin/templates/admin/admin-configmap.yaml
b/manifests/charts/admin/templates/admin/admin-configmap.yaml
index cec7275a..a4e91f1a 100644
--- a/manifests/charts/admin/templates/admin/admin-configmap.yaml
+++ b/manifests/charts/admin/templates/admin/admin-configmap.yaml
@@ -3,7 +3,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "admin.name" . }}-server-config
+ name: {{ include "admin.name" . }}-control-plane-config
namespace: {{ template "admin.namespace" . }}
labels:
{{- include "admin.labels" . | nindent 4 }}
diff --git a/manifests/charts/admin/templates/admin/admin-deployment.yaml
b/manifests/charts/admin/templates/admin/admin-deployment.yaml
index 1fc1c8c2..7cc0756f 100644
--- a/manifests/charts/admin/templates/admin/admin-deployment.yaml
+++ b/manifests/charts/admin/templates/admin/admin-deployment.yaml
@@ -148,9 +148,7 @@ spec:
{{- if $admin.volumes }}
{{- toYaml $admin.volumes | nindent 6 }}
{{- end }}
- - name: {{ include "admin.name" . }}-server-config
- configMap:
- name: {{ include "admin.name" . }}-server-config
+ - name: {{ include "admin.name" . }}-control-plane-config
{{- if $cp.tls.secretName }}
- name: general-tls-cert
secret:
diff --git a/manifests/charts/admin/templates/admin/admin-statefulset.yaml
b/manifests/charts/admin/templates/admin/admin-statefulset.yaml
index d3e792d4..beb38c1d 100644
--- a/manifests/charts/admin/templates/admin/admin-statefulset.yaml
+++ b/manifests/charts/admin/templates/admin/admin-statefulset.yaml
@@ -131,6 +131,9 @@ spec:
- name: {{ include "admin.name" . }}-server-config
configMap:
name: {{ include "admin.name" . }}-server-config
+ - name: scripts
+ configMap:
+ name: {{ template "job.name" . }}-scripts
{{- if $cp.tls.secretName }}
- name: general-tls-cert
secret:
diff --git a/manifests/charts/admin/templates/modular/jobs/jobs-scripts.yaml
b/manifests/charts/admin/templates/modular/jobs/jobs-scripts.yaml
deleted file mode 100644
index 08521ec5..00000000
--- a/manifests/charts/admin/templates/modular/jobs/jobs-scripts.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-{{- $jobs := .Values.jobs }}
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: {{ template "job.name" . }}-crds
- namespace: {{ template "job.namespace" . }}
- labels:
- {{- include "job.labels" . | nindent 4 }}
- {{- with $jobs.labels }}
- {{- toYaml . | nindent 4 }}
- {{- end }}
- annotations:
- "helm.sh/hook": "pre-upgrade,pre-install"
- "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
- {{- with $jobs.annotations }}
- {{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- template:
- metadata:
- name: {{ template "job.name" . }}-crds
- namespace: {{ template "job.namespace" . }}
- spec:
- restartPolicy: {{ $jobs.restartPolicy }}
- containers:
- - name: kubectl
- image: {{ $jobs.image.registry }}:{{ $jobs.image.tag }}
- imagePullPolicy: {{ $jobs.image.pullPolicy }}
- volumeMounts:
- - name: scripts
- mountPath: /scripts/application-dependent.sh
- subPath: application-dependent.sh
- volumes:
- - name: scripts
- configMap:
- name: {{ template "job.name" . }}-scripts
- defaultMode: 0755
----
-{{- $jobs := .Values.jobs }}
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ template "job.name" . }}-scripts
- namespace: {{ template "job.namespace" . }}
- labels:
- {{- include "job.labels" . | nindent 4 }}
- {{- with $jobs.labels }}
- {{- toYaml . | nindent 4 }}
- {{- end }}
- annotations:
- "helm.sh/hook": "pre-install"
- "helm.sh/hook-weight": "1"
- "helm.sh/hook-delete-policy": "before-hook-creation"
- {{- with $jobs.annotations }}
- {{- toYaml . | nindent 4 }}
- {{- end }}
-data:
- application-dependent.sh: |-
-
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-app-metrics.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-app-metrics.yaml
deleted file mode 100644
index 1768a1b7..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-app-metrics.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-app-traces.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-app-traces.yaml
deleted file mode 100644
index ae1e83ee..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-app-traces.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-ins-metrics.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-ins-metrics.yaml
deleted file mode 100644
index 1768a1b7..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-ins-metrics.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-ins-traces.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-ins-traces.yaml
deleted file mode 100644
index 1768a1b7..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-ins-traces.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-svc-metrics.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-svc-metrics.yaml
deleted file mode 100644
index 1768a1b7..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-svc-metrics.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git
a/manifests/charts/admin/templates/observable/grafana-resources-svc-traces.yaml
b/manifests/charts/admin/templates/observable/grafana-resources-svc-traces.yaml
deleted file mode 100644
index 1768a1b7..00000000
---
a/manifests/charts/admin/templates/observable/grafana-resources-svc-traces.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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.
diff --git a/manifests/charts/admin/templates/scripts.yaml
b/manifests/charts/admin/templates/scripts.yaml
new file mode 100644
index 00000000..39c7ba7e
--- /dev/null
+++ b/manifests/charts/admin/templates/scripts.yaml
@@ -0,0 +1,29 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: my-script
+data:
+ env.sh: |-
+
+ {{- .Files.Get "files/env.sh" | indent 4 }}
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: run-external-script
+spec:
+ template:
+ spec:
+ containers:
+ - name: script-runner
+ image: alpine:latest # 选择一个适合的基础镜像
+ command: ["/bin/sh", "-c", "/scripts/env.sh"]
+ volumeMounts:
+ - name: script-volume
+ mountPath: /scripts
+ restartPolicy: Never
+ volumes:
+ - name: script-volume
+ configMap:
+ name: my-script
+ backoffLimit: 4