diff --git a/ENVIRONMENT.rst b/ENVIRONMENT.rst index f791a75de..ea2e3df81 100644 --- a/ENVIRONMENT.rst +++ b/ENVIRONMENT.rst @@ -101,7 +101,9 @@ Environment Configuration Settings - **LOG_GROUP_BY_DATE**: (optional) enable grouping log by date. Default is False - group the log files based on the instance ID. - **DCS_ENABLE_KUBERNETES_API**: a non-empty value forces Patroni to use Kubernetes as a DCS. Default is empty. - **KUBERNETES_USE_CONFIGMAPS**: a non-empty value makes Patroni store its metadata in ConfigMaps instead of Endpoints when running on Kubernetes. Default is empty. -- **KUBERNETES_ROLE_LABEL**: name of the label containing Postgres role when running on Kubernetens. Default is 'spilo-role'. +- **KUBERNETES_ROLE_LABEL**: name of the label containing Postgres role when running on Kubernetes. Default is 'spilo-role'. +- **KUBERNETES_LEADER_LABEL_VALUE**: value of the pod label if Postgres role is primary when running on Kubernetes. Default is 'master'. +- **KUBERNETES_STANDBY_LEADER_LABEL_VALUE**: value of the pod label if Postgres role is standby_leader when running on Kubernetes. Default is 'master'. - **KUBERNETES_SCOPE_LABEL**: name of the label containing cluster name. Default is 'version'. - **KUBERNETES_LABELS**: a JSON describing names and values of other labels used by Patroni on Kubernetes to locate its metadata. Default is '{"application": "spilo"}'. - **INITDB_LOCALE**: database cluster's default UTF-8 locale (en_US by default) diff --git a/kubernetes/spilo_kubernetes.yaml b/kubernetes/spilo_kubernetes.yaml index 2eab92e64..b01da08fe 100644 --- a/kubernetes/spilo_kubernetes.yaml +++ b/kubernetes/spilo_kubernetes.yaml @@ -79,6 +79,10 @@ spec: value: spilo-cluster - name: KUBERNETES_ROLE_LABEL value: role + - name: KUBERNETES_LEADER_LABEL_VALUE + value: master + - name: KUBERNETES_STANDBY_LEADER_LABEL_VALUE + value: master - name: SPILO_CONFIGURATION value: | ## https://github.com/zalando/patroni#yaml-configuration bootstrap: diff --git a/postgres-appliance/Dockerfile b/postgres-appliance/Dockerfile index b31603610..84a7bdea9 100644 --- a/postgres-appliance/Dockerfile +++ b/postgres-appliance/Dockerfile @@ -73,7 +73,7 @@ COPY --from=dependencies-builder /builddeps/wal-g /usr/local/bin/ COPY build_scripts/patroni_wale.sh build_scripts/compress_build.sh /builddeps/ # Install patroni and wal-e -ENV PATRONIVERSION=3.3.4 +ENV PATRONIVERSION=4.0.4 ENV WALE_VERSION=1.1.1 WORKDIR / diff --git a/postgres-appliance/scripts/configure_spilo.py b/postgres-appliance/scripts/configure_spilo.py index 549070759..bf947c7ed 100755 --- a/postgres-appliance/scripts/configure_spilo.py +++ b/postgres-appliance/scripts/configure_spilo.py @@ -578,6 +578,8 @@ def get_placeholders(provider): placeholders.setdefault('CALLBACK_SCRIPT', '') placeholders.setdefault('DCS_ENABLE_KUBERNETES_API', '') placeholders.setdefault('KUBERNETES_ROLE_LABEL', 'spilo-role') + placeholders.setdefault('KUBERNETES_LEADER_LABEL_VALUE', 'master') + placeholders.setdefault('KUBERNETES_STANDBY_LEADER_LABEL_VALUE', 'master') placeholders.setdefault('KUBERNETES_SCOPE_LABEL', 'version') placeholders.setdefault('KUBERNETES_LABELS', KUBERNETES_DEFAULT_LABELS) placeholders.setdefault('KUBERNETES_USE_CONFIGMAPS', '')