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

✨Add initContainer to wait for postgresql Ready status #245

Merged
merged 1 commit into from
May 7, 2024

Conversation

francostellari
Copy link
Contributor

@francostellari francostellari commented May 3, 2024

Summary

Add initContainer to wait for postgresql Ready status.
This prevent kubeflex from acting on CP CRs before the database is ready
This dramatically speedup the creation of CPs and prevent crashes.

Related issue(s)

Fixes #

@francostellari
Copy link
Contributor Author

@pdettori (cc @MikeSpreitzer )

@francostellari francostellari changed the title ✨Add initContainer to wait for postgresql ready ✨Add initContainer to wait for postgresql Ready status May 3, 2024
Comment on lines +27 to +36
initContainers:
- name: wait-postgresql
image: quay.io/kubestellar/kubectl:1.29.3
command: ['sh', '-c']
args:
- |
while [[ $(kubectl get pods postgres-postgresql-0 -n kubeflex-system -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do
echo "waiting for postgresql pod"
sleep 5
done
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need to be here?

Copy link
Contributor Author

@francostellari francostellari May 3, 2024

Choose a reason for hiding this comment

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

@MikeSpreitzer because operator.yaml is generated from this file by make chart.
Changes made in operator.yaml would be overridden by kustomizer.

@@ -646,6 +646,18 @@ spec:
capabilities:
drop:
- ALL
initContainers:
- args:
- |
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not include this arg along with the other one in command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it is a preference, I like to write the script code on multiple lines, easier to copy&past for testing

Copy link
Collaborator

@pdettori pdettori left a comment

Choose a reason for hiding this comment

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

/lgtm

@pdettori pdettori merged commit fca18c2 into kubestellar:main May 7, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants