Difference between revisions of "Kubectl exec"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
* <code>[[kubectl]] exec -it my-redis-pod -c my-redis-container -- /bin/bash</code> | * <code>[[kubectl]] exec -it my-redis-pod -c my-redis-container -- /bin/bash</code> | ||
+ | |||
+ | |||
+ | [[kubectl exec -it]] -c your-elasticsearch-master-3 bash | ||
+ | [[error: you must specify at least one command for the container]] | ||
+ | |||
+ | |||
kubectl exec my-redis-pod -c my-redis-container /sbin/killall5 | kubectl exec my-redis-pod -c my-redis-container /sbin/killall5 |
Revision as of 07:16, 5 July 2022
https://kubernetes.io/docs/tasks/debug/debug-application/get-shell-running-container/
kubectl exec -it my-redis-pod -- /bin/bash
(Get a shell to a running container (https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/))
kubectl exec -it my-redis-pod -c my-redis-container -- /bin/bash
kubectl exec -it -c your-elasticsearch-master-3 bash error: you must specify at least one command for the container
kubectl exec my-redis-pod -c my-redis-container /sbin/killall5 kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead. command terminated with exit code 2
kubectl exec my-redis-pod -c my-redis-container /sbin/killall kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead. OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: "/sbin/killall": stat /sbin/killall: no such file or directory: unknown command terminated with exit code 126
kubectl exec envar-demo -- printenv
Related commands
Activities
See also
kubectl exec, kubectl exec -it
kubectl
: [cp | config | create
|delete
|edit | explain |
apply
|exec
|get
|set
|drain | uncordon | rolling-update
|rollout
|logs
|run
|auth
|label | annotate
|version
|top
|diff
|debug
|replace
|describe
|port-forward | proxy
|scale
|rollout
|api-resources
| expose deployment | expose | patch | attach | get endpoints | ~/.kube/config | kubectl logs --help | kubectl --help, kubectl-convert, kubectl autoscale, kubectl.kubernetes.io
Advertising: