diff --git a/helm/template/Chart.yaml b/helm/template/Chart.yaml index 0ca281a..968433c 100644 --- a/helm/template/Chart.yaml +++ b/helm/template/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: template description: A Helm library chart containing common templates, keeping application templates short type: library -version: 0.2.3 +version: 0.2.4 maintainers: - name: Jim Martens url: https://2martens.de @@ -10,10 +10,8 @@ sources: - https://git.2martens.de/2martens/cloud-configuration annotations: artifacthub.io/changes: | - - kind: fixed - description: Reverted path to secret for vault - - kind: fixed - description: Changed namespace for vault secrets app to release namespace + - kind: added + description: Added "template.annotations" artifacthub.io/signKey: | fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8 url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc diff --git a/helm/template/templates/_deployment.yaml b/helm/template/templates/_deployment.yaml index b2a6de7..0b0388a 100644 --- a/helm/template/templates/_deployment.yaml +++ b/helm/template/templates/_deployment.yaml @@ -5,6 +5,8 @@ metadata: name: {{ include "template.fullname" . }} labels: {{- include "template.labels" . | nindent 4 }} + annotations: + {{- include "template.annotations" . | nindent 4 }} spec: revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} {{- if not .Values.autoscaling.enabled }} @@ -24,6 +26,7 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} + {{- include "template.annotations" . | nindent 8 }} labels: {{- include "template.selectorLabels" . | nindent 8 }} spec: diff --git a/helm/template/templates/_helpers.tpl b/helm/template/templates/_helpers.tpl index bc60ae6..1848db1 100644 --- a/helm/template/templates/_helpers.tpl +++ b/helm/template/templates/_helpers.tpl @@ -41,6 +41,10 @@ app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | qu {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{- define "template.annotations" -}} +meta.helm.sh/release-name: {{ .Release.Name }} +meta.helm.sh/release-namespace: {{ .Release.Namespace }} +{{- end }} {{/* Selector labels diff --git a/helm/template/templates/_hpa.yaml b/helm/template/templates/_hpa.yaml index 745db5f..a1ae598 100644 --- a/helm/template/templates/_hpa.yaml +++ b/helm/template/templates/_hpa.yaml @@ -6,6 +6,8 @@ metadata: name: {{ include "template.fullname" . }} labels: {{- include "template.labels" . | nindent 4 }} + annotations: + {{- include "template.annotations" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/helm/template/templates/_ingress.yaml b/helm/template/templates/_ingress.yaml index 0538ca1..8edf0c1 100644 --- a/helm/template/templates/_ingress.yaml +++ b/helm/template/templates/_ingress.yaml @@ -8,10 +8,11 @@ metadata: name: {{ $fullName }} labels: {{- include "template.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} annotations: + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} + {{- include "template.annotations" . | nindent 4 }} spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }} diff --git a/helm/template/templates/_podmonitor.yaml b/helm/template/templates/_podmonitor.yaml index 78e47d7..f614e9b 100644 --- a/helm/template/templates/_podmonitor.yaml +++ b/helm/template/templates/_podmonitor.yaml @@ -8,6 +8,8 @@ metadata: labels: {{- include "template.labels" . | nindent 4 }} release: {{ .Values.prometheus.releaseName | quote | default "prometheus" }} + annotations: + {{- include "template.annotations" . | nindent 4 }} spec: podMetricsEndpoints: - port: "{{ .Values.application.actuatorPort }}" diff --git a/helm/template/templates/_secret.yaml b/helm/template/templates/_secret.yaml index 5fe41b0..143dc2a 100644 --- a/helm/template/templates/_secret.yaml +++ b/helm/template/templates/_secret.yaml @@ -6,6 +6,8 @@ metadata: name: {{ include "template.fullname" . }} labels: {{- include "template.labels" . | nindent 4 }} + annotations: + {{- include "template.annotations" . | nindent 4 }} data: {{- range $key, $value := .Values.secrets }} {{ $key }}: {{ $value | b64enc }} diff --git a/helm/template/templates/_service.yaml b/helm/template/templates/_service.yaml index efa077b..af2c63f 100644 --- a/helm/template/templates/_service.yaml +++ b/helm/template/templates/_service.yaml @@ -5,6 +5,8 @@ metadata: name: {{ include "template.fullname" . }} labels: {{- include "template.labels" . | nindent 4 }} + annotations: + {{- include "template.annotations" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: diff --git a/helm/template/templates/_serviceaccount.yaml b/helm/template/templates/_serviceaccount.yaml index 16a7d6b..da5fc66 100644 --- a/helm/template/templates/_serviceaccount.yaml +++ b/helm/template/templates/_serviceaccount.yaml @@ -6,9 +6,10 @@ metadata: name: {{ include "template.serviceAccountName" . }} labels: {{- include "template.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} annotations: + {{- with .Values.serviceAccount.annotations }} {{- toYaml . | nindent 4 }} {{- end }} + {{- include "template.annotations" . | nindent 4 }} {{- end }} {{- end }} diff --git a/helm/template/templates/_vault-secrets-app.yaml b/helm/template/templates/_vault-secrets-app.yaml index fefdc71..48646cb 100644 --- a/helm/template/templates/_vault-secrets-app.yaml +++ b/helm/template/templates/_vault-secrets-app.yaml @@ -7,6 +7,8 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "template.labels" . | nindent 4 }} + annotations: + {{- include "template.annotations" . | nindent 4 }} spec: appName: {{ .Values.vault.applicationName }} hcpAuthRef: {{ .Values.vault.operatorNamespace | default "vault-secrets-operator-system" }}/hcp-auth