added initcontainers for cart and loadbalancer

This commit is contained in:
Daniel Sanche 2020-01-22 11:33:57 -08:00
parent bf9e29fbba
commit 3026d2f88c
2 changed files with 11 additions and 0 deletions

View file

@ -26,6 +26,13 @@ spec:
app: cartservice
spec:
terminationGracePeriodSeconds: 5
initContainers:
- name: init-db-ready
image: redis:alpine
command: ['/bin/sh', '-c']
args:
- until redis-cli -h redis-cart -p 6379 ping; do echo waiting for redis-cart; sleep 2; done
#- for i in {1..100}; do sleep 1; if redis-cli -h redis-cart -p 6379 ping; then exit 0; fi; done; exit 1
containers:
- name: server
image: cartservice

View file

@ -29,6 +29,10 @@ spec:
spec:
terminationGracePeriodSeconds: 5
restartPolicy: Always
initContainers:
- name: init-frontend-ready
image: busybox:1.28
command: ['sh', '-c', 'until [[ "$(wget --spider -S http://frontend 2>&1 | grep HTTP/)" == " HTTP/1.1 200 OK" ]]; do echo waiting for frontend; sleep 2; done;']
containers:
- name: main
image: loadgenerator