Skip to content

Instantly share code, notes, and snippets.

@bharatmicrosystems
Created May 9, 2020 14:14
Show Gist options
  • Save bharatmicrosystems/56f53bcf38be5b931ab93f681355d214 to your computer and use it in GitHub Desktop.
Save bharatmicrosystems/56f53bcf38be5b931ab93f681355d214 to your computer and use it in GitHub Desktop.
$ for from in "foo" "bar" "legacy"; do for to in "foo" "bar" "legacy"; do kubectl exec $(kubectl get pod -l app=sleep -n ${from} -o jsonpath={.items..metadata.name}) -c sleep -n ${from} -- curl "http://httpbin.${to}:8000/ip" -s -o /dev/null -w "sleep.${from} to httpbin.${to}: %{http_code}\n"; done; done
sleep.foo to httpbin.foo: 200
sleep.foo to httpbin.bar: 200
sleep.foo to httpbin.legacy: 200
sleep.bar to httpbin.foo: 200
sleep.bar to httpbin.bar: 200
sleep.bar to httpbin.legacy: 200
sleep.legacy to httpbin.foo: 000
command terminated with exit code 56
sleep.legacy to httpbin.bar: 200
sleep.legacy to httpbin.legacy: 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment