Skip to content

Commit 44f8d3e

Browse files
committed
add-service-monitor-for-clustersynchro-manager
Signed-off-by: learner0810 <[email protected]>
1 parent 90b2fff commit 44f8d3e

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

charts/clusterpedia/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ version: 2.2.0
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "v0.7.1"
24+
appVersion: "v0.7.2"
2525

2626
sources:
2727
- "https://github.com/clusterpedia-io/clusterpedia-helm"

charts/clusterpedia/templates/clustersynchro-manager-metrics-service.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ kind: Service
33
metadata:
44
name: {{ include "clusterpedia.clustersynchroManager.fullname" . }}-metrics
55
namespace: {{ .Release.Namespace }}
6-
labels: {{- include "common.labels.standard" . | nindent 4 }}
6+
labels:
7+
app: {{ include "clusterpedia.clustersynchroManager.fullname" . }}
8+
{{- include "common.labels.standard" . | nindent 4 }}
79
spec:
810
ports:
911
- name: metrics
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor" }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "clusterpedia.clustersynchroManager.fullname" . }}-service-monitor
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
app: {{ include "clusterpedia.clustersynchroManager.fullname" . }}
9+
{{- if .Values.clustersynchroManager.serviceMonitor.labels }}
10+
{{- include "common.tplvalues.render" (dict "value" .Values.clustersynchroManager.serviceMonitor.labels "context" $) | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
selector:
14+
matchLabels:
15+
app: {{ include "clusterpedia.clustersynchroManager.fullname" . }}
16+
{{- include "common.labels.standard" . | nindent 6 }}
17+
endpoints:
18+
- port: metrics
19+
path: /metrics
20+
{{- end }}

charts/clusterpedia/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ clustersynchroManager:
277277
resourceLock: "leases"
278278
kubeStateMetrics:
279279
enabled: false
280+
serviceMonitor:
281+
labels: { }
280282

281283
## controller manager config
282284
controllerManager:
@@ -432,4 +434,4 @@ hookJob:
432434
registry: ghcr.io
433435
repository: cloudtty/cloudshell
434436
tag: "v0.4.0"
435-
pullPolicy: IfNotPresent
437+
pullPolicy: IfNotPresent

0 commit comments

Comments
 (0)