KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-exec - (SYNOPSIS) kubectl exec [OPTIONS] (DESCRIPTION) . (OPTIONS) -c, --container="" . kubectl.kubernetes.io/default-container . -f, --filename=[] --pod-running-timeout=1m0s ( 5s 2m 3h ) -q, --quiet=false (remote session) -i, --stdin=false (stdin) -t, --tty=false TTY (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) namespace . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc (preferences). export feature gate KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" namespace CLI --password="" (basic authentication) API --profile="none" . (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). ( timeout). -s, --server="" Kubernetes API --tls-server-name="" . hostname --token="" Bearer API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLES) # 'date' mypod kubectl exec mypod -- date # 'date' ruby-container mypod kubectl exec mypod -c ruby-container -- date # (raw terminal mode) stdin 'bash' ruby-container mypod # stdout/stderr 'bash' kubectl exec mypod -c ruby-container -i -t -- bash -il # /usr mypod # ( -i) # (--) / # / () # ( ls -t /usr "ls -t /usr") kubectl exec mypod -i -t -- ls -t /usr # 'date' deployment mydeployment kubectl exec deploy/mydeployment -- date # 'date' service myservice kubectl exec svc/myservice -- date (SEE ALSO) kubectl(1) (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)