Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apepg switchover failed #1326

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion addons/apecloud-postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ roles:
writable: false
votable: false
vars:
## the postgres leader pod name which is dynamically selected, caution to use it
- name: POSTGRES_LEADER_POD_NAME
valueFrom:
componentVarRef:
compDef: {{ include "apecloud-postgresql-14.cmpdName" . }}
optional: true
podNamesForRole:
role: leader
option: Optional
- name: POSTGRES_USER
valueFrom:
credentialVarRef:
Expand Down Expand Up @@ -225,6 +234,13 @@ lifecycleActions:
- /tools/config/dbctl/components
- apecloud-postgresql
- getrole
switchover:
exec:
command:
- /bin/sh
- -c
- |
/tools/syncerctl switchover --primary "$POSTGRES_LEADER_POD_NAME" ${KB_SWITCHOVER_CANDIDATE_NAME:+--candidate "$KB_SWITCHOVER_CANDIDATE_NAME"}
memberLeave:
exec:
container: postgresql
Expand Down Expand Up @@ -258,7 +274,7 @@ runtime:
- command:
- sh
- -c
- cp -r /bin/syncer /tools/
- cp -r /bin/syncer /bin/syncerctl /tools/
image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.syncer.repository }}:{{ .Values.image.syncer.tag }}
imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }}
name: init-syncer
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:
debug: false
syncer:
repository: apecloud/syncer
tag: "0.3.6"
tag: "0.4.0"

# refer: https://github.com/apecloud/dbctl/blob/main/docker/Dockerfile
dbctl:
Expand Down
Loading