kubectl-exec
TLDR
Execute command in pod
$ kubectl exec [pod-name] -- [command]
Open interactive shell$ kubectl exec -it [pod-name] -- /bin/sh
Execute in specific container$ kubectl exec [pod-name] -c [container] -- [command]
Execute bash in pod$ kubectl exec -it [pod-name] -- /bin/bash
SYNOPSIS
kubectl exec [options] pod-name -- command [args...]
DESCRIPTION
kubectl exec executes a command in a container running in a pod. Similar to docker exec. The double dash (--) separates kubectl options from the command to execute.
PARAMETERS
-c, --container name
Container name in multi-container pod.-i, --stdin
Pass stdin to container.-t, --tty
Allocate TTY.-n, --namespace name
Kubernetes namespace.
SEE ALSO
kubectl(1), kubectl-attach(1)


