Skip to content

Commit 35473cc

Browse files
authored
Merge pull request #345 from percona/K8SPG-607-patroni
K8SPG-607: Fix patroni.dynamicConfiguration in pg-db
2 parents 151b188 + 2d65d56 commit 35473cc

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

charts/pg-db/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: pg-db
33
description: 'A Helm chart to deploy the PostgreSQL database with the Percona Operator for PostgreSQL'
44
type: application
5-
version: 2.4.0
5+
version: 2.4.1
66
appVersion: 2.4.0
77
home: https://docs.percona.com/percona-operator-for-postgresql/2.0/
88
maintainers:

charts/pg-db/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,11 @@ The chart can be customized using the following configurable parameters:
193193
| `pmm.resources.requests.cpu` | Container resource request for CPU | `500m` |
194194
| `patroni.syncPeriodSeconds` | The interval for refreshing the leader lock and applying dynamicConfiguration | `10` |
195195
| `patroni.leaderLeaseDurationSeconds` | TTL of the cluster leader lock | `30` |
196+
| `patroni.dynamicConfiguration` | Custom PostgreSQL configuration options. Please note that configuration changes are automatically applied to the running instances without validation, so having an invalid config can make the cluster unavailable | `{}` |
196197
| `patroni.dynamicConfiguration.postgresql.parameters` | Custom PostgreSQL configuration options | `{}` |
197198
| `patroni.dynamicConfiguration.postgresql.pg_hba` | PostgreSQL Host-Based Authentication section | `{}` |
199+
| `patroni.switchover.enabled` | Enables or disables manual change of the cluster primary instance | `""` |
200+
| `patroni.switchover.targetInstance` | The name of the Pod that should be set as the new primary. When not specified, the new primary will be selected randomly | `""` |
198201
| `extensions.image` | Image for the custom PostgreSQL extension loader sidecar container | `""` |
199202
| `extensions.imagePullPolicy` | Policy for the custom extension sidecar container | `Always` |
200203
| `extensions.storage.type` | The cloud storage type used for backups. Only s3 type is currently supported. | `""` |

charts/pg-db/templates/cluster.yaml

+10-7
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,17 @@ spec:
500500
{{- if .Values.patroni.leaderLeaseDurationSeconds }}
501501
leaderLeaseDurationSeconds: {{ .Values.patroni.leaderLeaseDurationSeconds }}
502502
{{- end }}
503+
{{- if .Values.patroni.dynamicConfiguration }}
503504
dynamicConfiguration:
504-
postgresql:
505-
parameters:
506-
{{- .Values.patroni.dynamicConfiguration.postgresql.parameters | toYaml | nindent 10 }}
507-
pg_hba:
508-
{{- range $pg_hba_entry := .Values.patroni.dynamicConfiguration.postgresql.pg_hba }}
509-
- {{ $pg_hba_entry }}
510-
{{- end }}
505+
{{- .Values.patroni.dynamicConfiguration | toYaml | nindent 6 }}
506+
{{- end }}
507+
{{- if .Values.patroni.switchover }}
508+
switchover:
509+
enabled: {{ .Values.patroni.switchover.enabled }}
510+
{{- if .Values.patroni.switchover.targetInstance }}
511+
targetInstance: {{ .Values.patroni.switchover.targetInstance }}
512+
{{- end }}
513+
{{- end }}
511514
{{- end }}
512515

513516
{{- if .Values.extensions }}

charts/pg-db/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ pmm:
476476
# work_mem: 2MB
477477
# pg_hba:
478478
# - host all mytest 123.123.123.123/32 reject
479+
# switchover:
480+
# enabled: "true"
481+
# targetInstance: ""
479482

480483
# extensions:
481484
# image: percona/percona-postgresql-operator:2.4.0

0 commit comments

Comments
 (0)