From 1d8e6b4f04fa82261f02943d6f323647472113e6 Mon Sep 17 00:00:00 2001 From: Kenan Erdogan Date: Tue, 16 Jan 2024 09:44:11 +0100 Subject: [PATCH] [pgadmin4] improve pod annotations to be able to have more checksums (#235) --- charts/pgadmin4/Chart.yaml | 2 +- charts/pgadmin4/README.md | 1 + charts/pgadmin4/templates/deployment.yaml | 11 ++++++++++- charts/pgadmin4/values.yaml | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/charts/pgadmin4/Chart.yaml b/charts/pgadmin4/Chart.yaml index 02f97b28..d4efcac8 100644 --- a/charts/pgadmin4/Chart.yaml +++ b/charts/pgadmin4/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: pgAdmin4 is a web based administration tool for PostgreSQL database name: pgadmin4 -version: 1.20.0 +version: 1.21.0 appVersion: "8.1" keywords: - pgadmin diff --git a/charts/pgadmin4/README.md b/charts/pgadmin4/README.md index eb33baba..1610520b 100644 --- a/charts/pgadmin4/README.md +++ b/charts/pgadmin4/README.md @@ -112,6 +112,7 @@ The command removes nearly all the Kubernetes components associated with the cha | `tolerations` | Node tolerations for pod assignment | `[]` | | `affinity` | Node affinity for pod assignment | `{}` | | `podAnnotations` | Annotations for pod | `{}` | +| `templatedPodAnnotations` | Templated annotations for pod | `{}` | | `podLabels` | Labels for pod | `{}` | | `namespace` | Namespace where to deploy resources | `null` | | `init.resources` | Init container CPU/memory resource requests/limits | `{}` | diff --git a/charts/pgadmin4/templates/deployment.yaml b/charts/pgadmin4/templates/deployment.yaml index a343ee38..e641c428 100644 --- a/charts/pgadmin4/templates/deployment.yaml +++ b/charts/pgadmin4/templates/deployment.yaml @@ -29,14 +29,23 @@ spec: {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if or (not .Values.existingSecret) .Values.podAnnotations }} + {{- if or (not .Values.existingSecret) .Values.podAnnotations .Values.templatedPodAnnotations .Values.serverDefinitions.enabled }} annotations: {{- if .Values.podAnnotations }} {{- .Values.podAnnotations | toYaml | nindent 8 }} {{- end }} + {{- with .Values.templatedPodAnnotations }} + {{- tpl . $ | nindent 8 }} + {{- end }} {{- if not .Values.existingSecret }} checksum/secret: {{ include (print $.Template.BasePath "/auth-secret.yaml") . | sha256sum }} {{- end }} + {{- if and .Values.serverDefinitions.enabled ( eq .Values.serverDefinitions.resourceType "Secret" ) }} + checksum/secret-server-definitions: {{ include (print $.Template.BasePath "/server-definitions-secret.yaml") . | sha256sum }} + {{- end }} + {{- if and .Values.serverDefinitions.enabled ( ne .Values.serverDefinitions.resourceType "Secret" ) }} + checksum/config-server-definitions: {{ include (print $.Template.BasePath "/server-definitions-configmap.yaml") . | sha256sum }} + {{- end }} {{- end }} spec: diff --git a/charts/pgadmin4/values.yaml b/charts/pgadmin4/values.yaml index 4fceed5a..bb2e3517 100644 --- a/charts/pgadmin4/values.yaml +++ b/charts/pgadmin4/values.yaml @@ -323,6 +323,10 @@ affinity: {} ## Pod annotations ## podAnnotations: {} +templatedPodAnnotations: |- +# checksum/configmap-oauth2: {{ include "/templates/configmap-oauth2.yaml" $ | sha256sum }} +# checksum/secret-oauth2: "{{ include "/templates/secret-oauth2.yaml" $ | sha256sum }}" +# checksum/secret-pgpass: "{{ include "/templates/secret-pgpass.yaml" $ | sha256sum }}" ## Pod labels ##