kubectl exec -it demo-pod -- /bin/bashkubectl run test-shell -it --rm --image=ubuntu:18.04 --overrides='{"spec": { "nodeSelector": {"kubernetes.io/hostname": "eks-prod-4"}}}'- Use Netshoot
--image=nicolaka/netshoot - To detach from the shell and leave it running with the ability to re-attach, omit the
--rm. Then reattach withkubectl attach $pod-name -c $pod-container -it
kubectl port-forward OBJECT local:remotewhere OBJECT can be pod, deployment, replicaset, service
kubectl config view --minify --flattenwhere
--minify limits to the current config
--flatten include everything so the config is self contained