Skip to content

Commit

Permalink
[prometheus-adapter]: allow setting annotations on the deployment (#2951
Browse files Browse the repository at this point in the history
)

Signed-off-by: Wei Kin Huang <[email protected]>

Signed-off-by: Wei Kin Huang <[email protected]>
  • Loading branch information
weikinhuang authored Jan 26, 2023
1 parent 19f0289 commit 514680d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus-adapter
version: 4.0.2
version: 4.1.0
appVersion: v0.10.0
description: A Helm chart for k8s prometheus adapter
home: https://github.com/kubernetes-sigs/prometheus-adapter
Expand Down
18 changes: 11 additions & 7 deletions charts/prometheus-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
{{- if .Values.customAnnotations }}
{{- if or .Values.customAnnotations .Values.deploymentAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
{{- with .Values.customAnnotations }}
{{- toYaml .Values.customAnnotations | nindent 4 }}
{{- end }}
{{- with .Values.deploymentAnnotations }}
{{- toYaml .Values.deploymentAnnotations | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
Expand All @@ -17,10 +22,6 @@ spec:
{{- include "k8s-prometheus-adapter.selectorLabels" . | indent 6 }}
template:
metadata:
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 8 }}
{{- end }}
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 8 }}
{{- with .Values.podLabels }}
Expand All @@ -30,7 +31,10 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | trim | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.customAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ podLabels: {}
# Annotations added to the pod
podAnnotations: {}

# Annotations added to the deployment
deploymentAnnotations: {}

hostNetwork:
# Specifies if prometheus-adapter should be started in hostNetwork mode.
#
Expand Down

0 comments on commit 514680d

Please sign in to comment.