Skip to content

Commit

Permalink
Add labels for ServiceMonitor K8S objects
Browse files Browse the repository at this point in the history
Signed-off-by: csahithi <[email protected]>
  • Loading branch information
csahithi authored and girishmg committed Jun 1, 2024
1 parent 3680c6f commit ce6445d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm/ovn-kubernetes/templates/ovnkube-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ kind: ServiceMonitor
metadata:
labels:
k8s-app: ovnkube-master
{{- with .Values.monitoring.commonServiceMonitorSelectorLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: monitor-ovnkube-master
namespace: ovn-kubernetes
spec:
Expand Down Expand Up @@ -47,6 +50,9 @@ kind: ServiceMonitor
metadata:
labels:
k8s-app: ovnkube-node
{{- with .Values.monitoring.commonServiceMonitorSelectorLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: monitor-ovnkube-node
namespace: ovn-kubernetes
spec:
Expand Down Expand Up @@ -104,6 +110,9 @@ kind: ServiceMonitor
metadata:
labels:
k8s-app: ovnkube-cluster-manager
{{- with .Values.monitoring.commonServiceMonitorSelectorLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: monitor-ovnkube-cluster-manager
namespace: ovn-kubernetes
spec:
Expand Down
9 changes: 9 additions & 0 deletions helm/ovn-kubernetes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,12 @@ global:
ovnkube-identity:
# -- number of ovnube-identity pods, co-located with kube-apiserver process, so need to be the same number of control plane nodes
replicas: 1

# -- prometheus monitoring related fields
monitoring:
# -- specify the labels for serviceMonitors to be selected for target discovery.
# Prometheus operator defines what namespaces and what servicemonitors within these
# namespaces must be selected for target discovery. The fields defined below helps
# in defining that.
commonServiceMonitorSelectorLabels:
release: kube-prometheus-stack

0 comments on commit ce6445d

Please sign in to comment.