Skip to content

Commit

Permalink
Add initContainer to wait for postgresql ready
Browse files Browse the repository at this point in the history
Signed-off-by: francostellari <[email protected]>
  • Loading branch information
francostellari committed May 3, 2024
1 parent 2800de0 commit 9b684e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chart/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,18 @@ spec:
capabilities:
drop:
- ALL
initContainers:
- 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
command:
- sh
- -c
image: quay.io/kubestellar/kubectl:1.29.3
name: wait-postgresql
securityContext:
runAsNonRoot: true
serviceAccountName: kubeflex-controller-manager
Expand Down
10 changes: 10 additions & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ spec:
operator: In
values:
- linux
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
containers:
- name: kube-rbac-proxy
securityContext:
Expand Down

0 comments on commit 9b684e6

Please sign in to comment.