diff --git a/charts/cert-manager-webhook-etcd/Chart.yaml b/charts/cert-manager-webhook-etcd/Chart.yaml index eb64dcc..a163ea4 100644 --- a/charts/cert-manager-webhook-etcd/Chart.yaml +++ b/charts/cert-manager-webhook-etcd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cert-manager-webhook-etcd description: A Helm chart for cert-manager webhook with etcd DNS provider type: application -version: 0.1.0 +version: 0.2.0 appVersion: "1.0.0" keywords: - cert-manager diff --git a/charts/cert-manager-webhook-etcd/templates/_helpers.tpl b/charts/cert-manager-webhook-etcd/templates/_helpers.tpl index 55bbc9e..94a6421 100644 --- a/charts/cert-manager-webhook-etcd/templates/_helpers.tpl +++ b/charts/cert-manager-webhook-etcd/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "cert-manager-webhook-etcd.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.commonLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/charts/cert-manager-webhook-etcd/templates/apiservice.yaml b/charts/cert-manager-webhook-etcd/templates/apiservice.yaml index 57e91df..1caa279 100644 --- a/charts/cert-manager-webhook-etcd/templates/apiservice.yaml +++ b/charts/cert-manager-webhook-etcd/templates/apiservice.yaml @@ -5,6 +5,9 @@ metadata: labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/{{ include "cert-manager-webhook-etcd.servingCertificate" . }}" spec: group: {{ .Values.groupName }} diff --git a/charts/cert-manager-webhook-etcd/templates/deployment.yaml b/charts/cert-manager-webhook-etcd/templates/deployment.yaml index 28deae1..899871d 100644 --- a/charts/cert-manager-webhook-etcd/templates/deployment.yaml +++ b/charts/cert-manager-webhook-etcd/templates/deployment.yaml @@ -5,6 +5,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.webhook.replicaCount }} selector: @@ -18,6 +22,9 @@ spec: {{- end }} labels: {{- include "cert-manager-webhook-etcd.selectorLabels" . | nindent 8 }} + {{- with .Values.commonLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/cert-manager-webhook-etcd/templates/pki.yaml b/charts/cert-manager-webhook-etcd/templates/pki.yaml index cd630a1..0bdcb39 100644 --- a/charts/cert-manager-webhook-etcd/templates/pki.yaml +++ b/charts/cert-manager-webhook-etcd/templates/pki.yaml @@ -7,6 +7,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: selfSigned: {} --- @@ -18,6 +22,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: secretName: {{ include "cert-manager-webhook-etcd.rootCACertificate" . }} duration: {{ .Values.tls.caDuration }} @@ -34,6 +42,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: ca: secretName: {{ include "cert-manager-webhook-etcd.rootCACertificate" . }} @@ -46,6 +58,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: secretName: {{ include "cert-manager-webhook-etcd.servingCertificate" . }} duration: {{ .Values.tls.duration }} diff --git a/charts/cert-manager-webhook-etcd/templates/rbac.yaml b/charts/cert-manager-webhook-etcd/templates/rbac.yaml index 15321fb..74fee79 100644 --- a/charts/cert-manager-webhook-etcd/templates/rbac.yaml +++ b/charts/cert-manager-webhook-etcd/templates/rbac.yaml @@ -4,6 +4,10 @@ metadata: name: {{ include "cert-manager-webhook-etcd.fullname" . }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} rules: - apiGroups: - "" @@ -20,6 +24,10 @@ metadata: name: {{ include "cert-manager-webhook-etcd.fullname" . }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -38,6 +46,10 @@ metadata: namespace: kube-system labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -53,6 +65,10 @@ metadata: name: {{ include "cert-manager-webhook-etcd.fullname" . }}:auth-delegator labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -69,6 +85,10 @@ metadata: name: {{ include "cert-manager-webhook-etcd.fullname" . }}:domain-solver labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} rules: - apiGroups: - {{ .Values.groupName }} @@ -83,6 +103,10 @@ metadata: name: {{ include "cert-manager-webhook-etcd.fullname" . }}:domain-solver labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/cert-manager-webhook-etcd/templates/service.yaml b/charts/cert-manager-webhook-etcd/templates/service.yaml index f529275..55cf30f 100644 --- a/charts/cert-manager-webhook-etcd/templates/service.yaml +++ b/charts/cert-manager-webhook-etcd/templates/service.yaml @@ -5,6 +5,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/charts/cert-manager-webhook-etcd/templates/serviceaccount.yaml b/charts/cert-manager-webhook-etcd/templates/serviceaccount.yaml index 9c003ec..bee97a9 100644 --- a/charts/cert-manager-webhook-etcd/templates/serviceaccount.yaml +++ b/charts/cert-manager-webhook-etcd/templates/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cert-manager-webhook-etcd.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} + {{- with merge (deepCopy (.Values.serviceAccount.annotations | default dict)) .Values.commonAnnotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/cert-manager-webhook-etcd/values.yaml b/charts/cert-manager-webhook-etcd/values.yaml index e879350..bc43b2d 100644 --- a/charts/cert-manager-webhook-etcd/values.yaml +++ b/charts/cert-manager-webhook-etcd/values.yaml @@ -25,6 +25,12 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +# Labels to add to all deployed resources (including the webhook pods) +commonLabels: {} + +# Annotations to add to all deployed resources (use podAnnotations for the pods) +commonAnnotations: {} + serviceAccount: # Specifies whether a service account should be created create: true