Skip to content

Commit

Permalink
pgupgrade: add init container to delay startup of old deployment (PRO…
Browse files Browse the repository at this point in the history
…JQUAY-8092) (#984)

waits for existing postgresql pod to scale down before the old pod is up

Co-authored-by: Shubhra Deshpande <shubhrajayant+github.com>
  • Loading branch information
deshpandevlab authored Oct 21, 2024
1 parent cc79ff8 commit d8bc894
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ spec:
- name: postgres-data
persistentVolumeClaim:
claimName: clair-postgres-13
initContainers:
- name: check-postgres-scale-down
image: quay.io/sclorg/postgresql-13-c9s:latest
command:
- /bin/sh
- -c
- |
echo "Waiting for 30 seconds before starting the main container..."
sleep 30
containers:
- name: postgres
image: quay.io/sclorg/postgresql-13-c9s:latest
Expand Down

1 comment on commit d8bc894

@ibazulic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Termination of the old contianer might take a longer time. Consider not using a fixed timeout, but instead uising Kubernetes events to monitor when the pod is actually removed. Otherwise, crashloops might occur.

Please sign in to comment.