@@ -86,6 +86,10 @@ kubectl label node ambient-worker3 topology.kubernetes.io/subzone=subzone3
8686```
8787
88882 . start test servers
89+ - create ` sample ` namespace
90+ ```
91+ kubectl create namespace sample
92+ ```
8993- run a service
9094```
9195kubectl apply -n sample -f - <<EOF
262266
263267- Test the access.
264268```
265- $ kubectl exec "$(kubectl get pod -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
269+ kubectl exec -n sample "$(kubectl get pod -n sample -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
266270```
267271The output is from the helloworld-region.zone1.subzone1 that is currently co-located on the ambient-worker.
268272```
@@ -272,13 +276,11 @@ $ Hello version: region.zone1.subzone1, instance: helloworld-region.zone1.subzon
272276
273277- Remove the service on the ambient-worker and test Failover.
274278```
275- kubectl get deployment
276- # list of name
277- kubectl delete deployment <name> # name of the pod on the ambient-worker
279+ kubectl delete deployment -n sample helloworld-region.zone1.subzone1
278280```
279281
280282```
281- kubectl exec "$(kubectl get pod -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
283+ kubectl exec -n sample "$(kubectl get pod -n sample -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
282284```
283285
284286The output is helloworld-region.zone1.subzone2, and a failover of the traffic has occurred.
@@ -288,12 +290,13 @@ $ Hello version: region.zone1.subzone2, instance: helloworld-region.zone1.subzon
288290
289291- Relabel the locality of the ambient-worker3 same as the worker2 and test.
290292```
291- kubectl label node ambient-worker3 topology.kubernetes.io/region=region
292- kubectl label node ambient-worker3 topology.kubernetes.io/zone=zone1
293- kubectl label node ambient-worker3 topology.kubernetes.io/subzone=subzone2
293+ kubectl label node ambient-worker3 topology.kubernetes.io/zone=zone1 --overwrite
294+ kubectl label node ambient-worker3 topology.kubernetes.io/subzone=subzone2 --overwrite
294295```
295296delete helloworld-region.zone2.subzone3 and re-apply the development pod as follows, then run test:
296297```
298+ kubectl delete deployment -n sample helloworld-region.zone2.subzone3
299+
297300kubectl apply -n sample -f - <<EOF
298301apiVersion: apps/v1
299302kind: Deployment
333336
334337test multi times:
335338```
336- kubectl exec "$(kubectl get pod -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
339+ kubectl exec -n sample "$(kubectl get pod -n sample -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -c sleep -- curl -sSL "http://helloworld:5000/hello"
337340```
338341
339342The output randomly shows helloworld-region.zone1.subzone2 and helloworld-region.zone1.subzone2-worker3.
0 commit comments