File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,13 @@ sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-sys
197197
198198sshcmd "apply app.yaml" "kubectl apply -f /root/app.yaml"
199199
200+ await_sshcmd_output "await alpine pod ready" \
201+ {kubectl get pods --selector=name=alpine -o jsonpath='{.items[*].status.phase}' ; echo} \
202+ "Running"
200203await_sshcmd_output "await nginx pod ready" \
201204 {kubectl get pods --selector=name=nginx -o jsonpath='{.items[*].status.phase}' ; echo} \
202205 "Running"
203- puts "SUCCESS application pod ready"
206+ puts "SUCCESS application pods ready"
204207
205208sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-system get -o wide pods ; echo ; kubectl --namespace=default get -o wide pods"
206209
@@ -213,6 +216,25 @@ if [string match "Welcome to nginx!" $curl] {
213216}
214217puts "SUCCESS nginx responded well"
215218
219+ send_sshcmd {kubectl exec $(kubectl get pods -l name==alpine -o=jsonpath='{.items[*].metadata.name}') -- wget -q -O - http://nginx/}
220+ expect -i $ssh_sid -timeout 10 \
221+ "Welcome to nginx!" {
222+ puts "SUCCESS intra-pod networking ok"
223+ } $ssh_prompt {
224+ puts "FAIL intra-pod networking (returned to prompt)"
225+ kill ssh_sid lk_sid
226+ exit 1
227+ } timeout {
228+ puts "FAIL intra-pod networking (timeout)"
229+ kill ssh_sid lk_sid
230+ exit 1
231+ } eof {
232+ puts "FAIL intra-pod networking (eof)"
233+ kill ssh_sid lk_sid
234+ exit 1
235+ }
236+ await_ssh_prompt "intra-pod networking"
237+
216238kill ssh_sid
217239
218240puts "RUN poweroff -f"
Original file line number Diff line number Diff line change @@ -47,3 +47,24 @@ files:
4747 nodePort: 30002
4848 selector:
4949 name: nginx
50+ ---
51+ apiVersion: extensions/v1beta1
52+ kind: Deployment
53+ metadata:
54+ name: alpine
55+ labels:
56+ name: alpine
57+ namespace: default
58+ spec:
59+ replicas: 1
60+ template:
61+ metadata:
62+ labels:
63+ name: alpine
64+ spec:
65+ containers:
66+ - name: alpine
67+ image: alpine:3.7
68+ command: ["/bin/sh", "-c", "while : ; do sleep 1h ; done"]
69+ nodeSelector:
70+ beta.kubernetes.io/os: linux
You can’t perform that action at this time.
0 commit comments