Skip to content

Commit

Permalink
Add serviceMonitor.labels parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Torres <[email protected]>
  • Loading branch information
torredil committed Oct 6, 2022
1 parent 7016a78 commit a9f8cdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions charts/aws-ebs-csi-driver/templates/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions charts/aws-ebs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# ---
Expand Down

0 comments on commit a9f8cdc

Please sign in to comment.