From 5222318098155d7591486b061013beecce7ada7f Mon Sep 17 00:00:00 2001 From: Rob Kenis Date: Wed, 28 Aug 2024 09:15:44 +0200 Subject: [PATCH] Allow podAnnotations via helm values for Postgres operator This allows users to set annotations on the pods for example for Prometheus. --- charts/pg-operator/Chart.yaml | 2 +- charts/pg-operator/README.md | 1 + charts/pg-operator/templates/deployment.yaml | 4 ++++ charts/pg-operator/values.yaml | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/pg-operator/Chart.yaml b/charts/pg-operator/Chart.yaml index ef3fe079..3c1c7e62 100644 --- a/charts/pg-operator/Chart.yaml +++ b/charts/pg-operator/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: pg-operator description: 'A Helm chart to deploy the Percona Operator for PostgreSQL' type: application -version: 2.4.1 +version: 2.4.2 appVersion: 2.4.1 home: https://docs.percona.com/percona-operator-for-postgresql/2.0/ maintainers: diff --git a/charts/pg-operator/README.md b/charts/pg-operator/README.md index a694ee43..36ff9467 100644 --- a/charts/pg-operator/README.md +++ b/charts/pg-operator/README.md @@ -42,6 +42,7 @@ Chart. | `logStructured` | Force PG operator to print JSON-wrapped log messages | `false` | | `logLevel` | PG Operator logging level | `INFO` | | `disableTelemetry` | Disable sending PG Operator telemetry data to Percona | `false` | +| `podAnnotations` | Add annotations to the Operator Pod | `{}` | | `watchNamespace` | Set this variable if the target cluster namespace differs from operators namespace | `` | | `watchAllNamespaces` | K8S Cluster-wide operation | `false` | diff --git a/charts/pg-operator/templates/deployment.yaml b/charts/pg-operator/templates/deployment.yaml index 2f8ef214..86b2cc89 100644 --- a/charts/pg-operator/templates/deployment.yaml +++ b/charts/pg-operator/templates/deployment.yaml @@ -25,6 +25,10 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/part-of: {{ include "postgres-operator.name" . }} pgv2.percona.com/control-plane: postgres-operator + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ include "postgres-operator.fullname" . }} {{- with .Values.imagePullSecrets }} diff --git a/charts/pg-operator/values.yaml b/charts/pg-operator/values.yaml index f815af9e..662a068e 100644 --- a/charts/pg-operator/values.yaml +++ b/charts/pg-operator/values.yaml @@ -37,6 +37,8 @@ tolerations: [] affinity: {} +podAnnotations: {} + # disableTelemetry: according to # https://docs.percona.com/percona-operator-for-postgresql/2.0/telemetry.html # this is how you can disable telemetry collection