WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b2bda5b

Browse files
zhifanggaopan3793
authored andcommitted
[KYUUBI #6840] Fix PodMonitor pods selection
### Why are the changes needed? I am using the podminitor of kyuubi metrics, But I found using the podmonitor's selector.matchLabels can not select correct pods . So I fix it . I also changed the values.yaml to add an example of podmonitor to improve the usability. ### How was this patch tested? ``` helm install kyuubi . # kubectl get podmonitor kyuubi -oyaml apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: annotations: meta.helm.sh/release-name: kyuubi meta.helm.sh/release-namespace: default creationTimestamp: "2024-12-06T07:46:12Z" generation: 1 labels: app.kubernetes.io/instance: kyuubi app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kyuubi app.kubernetes.io/version: 1.8.0 helm.sh/chart: kyuubi-0.1.0 name: kyuubi namespace: default resourceVersion: "7583800" uid: 0dd11e43-d126-434e-988a-7f1914586e2b spec: podMetricsEndpoints: - path: /metrics port: prometheus selector: matchLabels: app.kubernetes.io/instance: kyuubi app.kubernetes.io/name: kyuubi # kubectl get po -l app.kubernetes.io/instance=kyuubi NAME READY STATUS RESTARTS AGE kyuubi-0 1/1 Running 0 24m kyuubi-1 1/1 Running 0 22m # kubectl get po -l app.kubernetes.io/name=kyuubi NAME READY STATUS RESTARTS AGE kyuubi-0 1/1 Running 0 24m kyuubi-1 1/1 Running 0 23m ``` ### Was this patch authored or co-authored using generative AI tooling? No Closes #6840 from zhifanggao/change_podmonitor. Closes #6840 092f13f [zhifanggao] change the podmonitor to select pods correctly Authored-by: zhifanggao <[email protected]> Signed-off-by: Cheng Pan <[email protected]> (cherry picked from commit 99e27d4) Signed-off-by: Cheng Pan <[email protected]>
1 parent eb65d3a commit b2bda5b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

charts/kyuubi/templates/kyuubi-podmonitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ metadata:
2525
spec:
2626
selector:
2727
matchLabels:
28-
app: {{ .Release.Name }}
28+
{{- include "kyuubi.selectorLabels" . | nindent 6 }}
2929
podMetricsEndpoints:
3030
{{- toYaml .Values.metrics.podMonitor.podMetricsEndpoints | nindent 4 }}
3131
{{- end }}

charts/kyuubi/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ metrics:
288288
enabled: false
289289
# List of pod endpoints serving metrics to be scraped by Prometheus, see Prometheus Operator docs for more details
290290
podMetricsEndpoints: []
291+
# podMetricsEndpoints:
292+
# - path: /metrics
293+
# port: prometheus
291294

292295
# ServiceMonitor by Prometheus Operator
293296
serviceMonitor:

0 commit comments

Comments
 (0)