From a9f8cdcf430162c961cf1ed010d0c3120c859dcf Mon Sep 17 00:00:00 2001 From: Eddie Torres Date: Thu, 6 Oct 2022 17:46:06 +0000 Subject: [PATCH] Add serviceMonitor.labels parameter Signed-off-by: Eddie Torres --- charts/aws-ebs-csi-driver/templates/metrics.yaml | 10 ++++++---- charts/aws-ebs-csi-driver/values.yaml | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/metrics.yaml b/charts/aws-ebs-csi-driver/templates/metrics.yaml index db4ac0d399..1fbba24c68 100644 --- a/charts/aws-ebs-csi-driver/templates/metrics.yaml +++ b/charts/aws-ebs-csi-driver/templates/metrics.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Service metadata: name: ebs-csi-controller - namespace: kube-system + namespace: {{ .Release.Namespace }} labels: app: ebs-csi-controller spec: @@ -21,17 +21,19 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: ebs-csi-controller - namespace: kube-system + namespace: {{ .Release.Namespace }} labels: app: ebs-csi-controller - release: prometheus + {{- if .Values.controller.serviceMonitor.labels }} + {{- toYaml .Values.controller.serviceMonitor.labels | nindent 4 }} + {{- end }} spec: selector: matchLabels: app: ebs-csi-controller namespaceSelector: matchNames: - - kube-system + - {{ .Release.Namespace }} endpoints: - targetPort: 3301 path: /metrics diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 047f3fc841..7d1431b77c 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -140,6 +140,10 @@ controller: # The default is empty string, which means metrics endpoint is disabled. # --- enableMetrics: false + serviceMonitor: + # Additional labels for ServiceMonitor object + labels: + release: prometheus # If set to true, AWS API call metrics will be exported to the following # TCP endpoint: "0.0.0.0:3301" # ---