Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serviceMonitor.labels parameter #1419

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 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 @@ -16,22 +16,24 @@ spec:
targetPort: 3301
type: ClusterIP
---
{{- if (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
{{- if or .Values.controller.serviceMonitor.forceEnable (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
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
6 changes: 6 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,12 @@ controller:
# The default is empty string, which means metrics endpoint is disabled.
# ---
enableMetrics: false
serviceMonitor:
# Enables the ServiceMonitor resource even if the prometheus-operator CRDs are not installed
forceEnable: false
# 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