-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
Signed-off-by: francostellari <[email protected]>
@pdettori (cc @MikeSpreitzer ) |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: | |||
- | |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
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 #