Skip to content

Commit 518d2f6

Browse files
authored
Integrate Patroni 4.x (zalando#1050)
* Integrate Patroni v4.x * set docs * update to latest patroni version
1 parent 39a6c8f commit 518d2f6

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

ENVIRONMENT.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ Environment Configuration Settings
101101
- **LOG_GROUP_BY_DATE**: (optional) enable grouping log by date. Default is False - group the log files based on the instance ID.
102102
- **DCS_ENABLE_KUBERNETES_API**: a non-empty value forces Patroni to use Kubernetes as a DCS. Default is empty.
103103
- **KUBERNETES_USE_CONFIGMAPS**: a non-empty value makes Patroni store its metadata in ConfigMaps instead of Endpoints when running on Kubernetes. Default is empty.
104-
- **KUBERNETES_ROLE_LABEL**: name of the label containing Postgres role when running on Kubernetens. Default is 'spilo-role'.
104+
- **KUBERNETES_ROLE_LABEL**: name of the label containing Postgres role when running on Kubernetes. Default is 'spilo-role'.
105+
- **KUBERNETES_LEADER_LABEL_VALUE**: value of the pod label if Postgres role is primary when running on Kubernetes. Default is 'master'.
106+
- **KUBERNETES_STANDBY_LEADER_LABEL_VALUE**: value of the pod label if Postgres role is standby_leader when running on Kubernetes. Default is 'master'.
105107
- **KUBERNETES_SCOPE_LABEL**: name of the label containing cluster name. Default is 'version'.
106108
- **KUBERNETES_LABELS**: a JSON describing names and values of other labels used by Patroni on Kubernetes to locate its metadata. Default is '{"application": "spilo"}'.
107109
- **INITDB_LOCALE**: database cluster's default UTF-8 locale (en_US by default)

kubernetes/spilo_kubernetes.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ spec:
7979
value: spilo-cluster
8080
- name: KUBERNETES_ROLE_LABEL
8181
value: role
82+
- name: KUBERNETES_LEADER_LABEL_VALUE
83+
value: master
84+
- name: KUBERNETES_STANDBY_LEADER_LABEL_VALUE
85+
value: master
8286
- name: SPILO_CONFIGURATION
8387
value: | ## https://github.com/zalando/patroni#yaml-configuration
8488
bootstrap:

postgres-appliance/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ COPY --from=dependencies-builder /builddeps/wal-g /usr/local/bin/
7373
COPY build_scripts/patroni_wale.sh build_scripts/compress_build.sh /builddeps/
7474

7575
# Install patroni and wal-e
76-
ENV PATRONIVERSION=3.3.4
76+
ENV PATRONIVERSION=4.0.4
7777
ENV WALE_VERSION=1.1.1
7878

7979
WORKDIR /

postgres-appliance/scripts/configure_spilo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ def get_placeholders(provider):
578578
placeholders.setdefault('CALLBACK_SCRIPT', '')
579579
placeholders.setdefault('DCS_ENABLE_KUBERNETES_API', '')
580580
placeholders.setdefault('KUBERNETES_ROLE_LABEL', 'spilo-role')
581+
placeholders.setdefault('KUBERNETES_LEADER_LABEL_VALUE', 'master')
582+
placeholders.setdefault('KUBERNETES_STANDBY_LEADER_LABEL_VALUE', 'master')
581583
placeholders.setdefault('KUBERNETES_SCOPE_LABEL', 'version')
582584
placeholders.setdefault('KUBERNETES_LABELS', KUBERNETES_DEFAULT_LABELS)
583585
placeholders.setdefault('KUBERNETES_USE_CONFIGMAPS', '')

0 commit comments

Comments
 (0)