Skip to content

Commit

Permalink
add initContainer for nginx to wait for gateway to be available befor…
Browse files Browse the repository at this point in the history
…e start up;

Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed May 27, 2021
1 parent 561c485 commit 4246d3f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions deployment/kubernetes/deploymentFiles/nginx/nginx.yaml
Expand Up @@ -30,6 +30,18 @@ spec:
labels:
app: nginx
spec:
initContainers:
- name: wait-for-gateway
image: curlimages/curl:latest
args:
- /bin/sh
- -c
- >
set -x;
while [[ "$(curl -sL -w "%{http_code}\n" http://gateway:8080/health -o /dev/null)" != "200" ]]; do
echo '.'
sleep 15;
done
containers:
- name: nginx
image: docker.io/nginx:1.20-alpine
Expand Down

0 comments on commit 4246d3f

Please sign in to comment.