update command nslookup target to include fully qualified service name, namespace picked up from running pod (#19603)

This commit is contained in:
James Spurin
2020-03-16 21:34:30 +00:00
committed by GitHub
parent b76520526d
commit 9e0f7b4eb3
6 changed files with 12 additions and 12 deletions
@@ -111,10 +111,10 @@ spec:
initContainers:
- name: init-myservice
image: busybox:1.28
command: ['sh', '-c', 'until nslookup myservice; do echo "En attente de myservice"; sleep 2; done;']
command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo en attente de myservice; sleep 2; done"]
- name: init-mydb
image: busybox:1.28
command: ['sh', '-c', 'until nslookup mydb; do echo "En attente de mydb"; sleep 2; done;']
command: ['sh', '-c', "until nslookup mydb.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo en attente de mydb; sleep 2; done"]
```
Les fichiers YAML suivants résument les services `mydb` et `myservice` :