Skip to content

Commit

Permalink
Merge pull request #245 from francostellari/wait-postgresql
Browse files Browse the repository at this point in the history
✨Add initContainer to wait for postgresql Ready status
  • Loading branch information
pdettori authored May 7, 2024
2 parents 2800de0 + 9b684e6 commit fca18c2
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 fca18c2

Please sign in to comment.