Hello All, In the last chapter, *more certification tips* its mentioned " Practi . . .

R:
Hello All, In the last chapter, more certification tips its mentioned " Practice multiplying kubectl commands, like running nested kubectl commands to get some output and do some operation on top it" . What could be the example of such command ? From kubectl cheatsheet I got following. I couldn’t find any nesting examples

for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo $pod && kubectl exec -it $pod -- env; done

Ly Quoc Bao:
Hey R, it depends on what you want to do. Basically, there are 2 places which you can overwrite:

  1. kubectl command: you can filter pods by adding --selector
  2. kubectl exec: change the command for getting the information such as curl ip, cat /etc/os-release, pwd,…
    Overall, you can run the specific command on multiple filtered pods.