To test if its working as expected, we’ll exec into the DJ pod. To do that, we get the name of our dj pod by listing all pods with the dj selector:
kubectl get pods -nprod -l app=dj
Output should be similar to:
Next, we’ll exec into the DJ pod, and make a curl request to the virtual service jazz, simulating what would happen if code running in the same pod made a request to the metal service by entering the following:
kubectl exec -nprod -it <your-dj-pod-name> -c dj bash
Output should be similar to:
Now that we have a root prompt into the DJ pod, we’ll issue our curl request to the jazz virtual service:
while [ 1 ]; do curl http://metal.prod.svc.cluster.local:9080/;echo; done
Output should loop about 50⁄50 between the v1 and v2 versions of the metal service, similar to:
Hit CTRL-C to stop the looping.
We’ll next perform a similar test, but against the jazz service. Issue a curl request to the jazz virtual service from within the dj pod:
while [ 1 ]; do curl http://jazz.prod.svc.cluster.local:9080/;echo; done
Output should loop about in a 90⁄10 ratio between the v1 and v2 versions of the jazz service, similar to:
Hit CTRL-C to stop the looping, and type exit to exit the pod’s shell.
Congrats on implementing the DJ App onto App Mesh!