Kubectl exec's to the first pod in the current or given namespace
Shows the full auto-generated 'kubectl exec'commandfor clarity
Execs /bin/sh because we can't be sure /bin/bash exists in a lot of containers
This is useful to quickly jump in to any pod in a namespace/deployment to debug a web farm etc.
Optional args include namespace for the first arg unless it starts with the dash in which case it's assumed to be a regular filter switch, and any remaining args are passed straight to 'kubectl get pods' to be used as filters, eg. -l app=nginx
First arg is the optional pod container unless it starts with a dash (if no container is specified we'll pick the first one and show you in the kubectl output)
Any other args in are passed straight to 'kubectl get pods' to be used as filters, eg. -n prod -l app=nginx
for a different approaching using just a partial pod name and optional partial container name, auto-determines the namespace, it's simpler and less typing in most cases