#kubectl config get-clusters kubectx #kubectl get ns #--context <cluster> kubens -c
custom output for parsing
-o json -o yaml
e.g. when the sidecar is in your way…
kubectl get pods
kubectl get pod POD_NAME_HERE -o jsonpath='{.spec.containers[*].name}'; echo
gives e.g.
exporter haproxy
so let’s get into the haproxy container
kubectl exec -ti POD_NAME_HERE -c haproxy -- /bin/bash
https://stackoverflow.com/questions/37464518/how-to-format-the-output-of-kubectl-describe-to-json