Skip to content

Commit

Permalink
Integrate Patroni 4.x (zalando#1050)
Browse files Browse the repository at this point in the history
* Integrate Patroni v4.x
* set docs
* update to latest patroni version
  • Loading branch information
idanovinda authored Dec 6, 2024
1 parent 39a6c8f commit 518d2f6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ENVIRONMENT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions kubernetes/spilo_kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
2 changes: 2 additions & 0 deletions postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit 518d2f6

Please sign in to comment.