Skip to content

Commit

Permalink
merging annotations globally and locally
Browse files Browse the repository at this point in the history
  • Loading branch information
tkennes committed May 10, 2023
1 parent ccb7243 commit 55727c5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion keda/templates/17-keda-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
{{- with (mergeOverwrite (deepCopy .Values.additionalAnnotations) .Values.prometheus.operator.podMonitor.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/17-keda-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
{{- with (mergeOverwrite (deepCopy .Values.additionalAnnotations) .Values.prometheus.operator.serviceMonitor.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/26-metrics-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
{{- with (mergeOverwrite (deepCopy .Values.additionalAnnotations) .Values.prometheus.metricServer.podMonitor.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
6 changes: 4 additions & 2 deletions keda/templates/27-metrics-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
{{- with (mergeOverwrite (deepCopy .Values.additionalAnnotations) .Values.prometheus.metricServer.serviceMonitor.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/33-webhooks-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.webhooks.name }}
{{- with .Values.additionalAnnotations }}
{{- with (mergeOverwrite (deepCopy .Values.additionalAnnotations) .Values.prometheus.webhooks.serviceMonitor.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ prometheus:
serviceMonitor:
# Enables ServiceMonitor creation for the Prometheus Operator
enabled: false
annotations: {}
jobLabel:
targetLabels: []
podTargetLabels: []
Expand All @@ -381,6 +382,7 @@ prometheus:
podMonitor:
# Enables PodMonitor creation for the Prometheus Operator
enabled: false
annotations: {}
interval:
scrapeTimeout:
namespace:
Expand All @@ -392,6 +394,7 @@ prometheus:
serviceMonitor:
# Enables ServiceMonitor creation for the Prometheus Operator
enabled: false
annotations: {}
jobLabel:
targetLabels: []
podTargetLabels: []
Expand All @@ -404,6 +407,7 @@ prometheus:
podMonitor:
# Enables PodMonitor creation for the Prometheus Operator
enabled: false
annotations: {}
interval:
scrapeTimeout:
namespace:
Expand All @@ -429,6 +433,7 @@ prometheus:
serviceMonitor:
# Enables ServiceMonitor creation for the Prometheus webhooks
enabled: false
annotations: {}
jobLabel:
targetLabels: []
podTargetLabels: []
Expand All @@ -441,6 +446,7 @@ prometheus:
prometheusRules:
# Enables PrometheusRules creation for the Prometheus Operator
enabled: false
annotations: {}
namespace:
additionalLabels: {}
alerts: []
Expand Down

0 comments on commit 55727c5

Please sign in to comment.