Difference between revisions of "Kubectl exec"

From wikieduonline
Jump to navigation Jump to search
Line 24: Line 24:
  
 
== Activities ==
 
== Activities ==
* [[Get a shell to a running container]]
+
* [[Get a shell to a running container]]: <code>[[kubectl exec]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 14:55, 4 July 2022

https://kubernetes.io/docs/tasks/debug/debug-application/get-shell-running-container/

  • kubectl exec -it my-redis-pod -c my-redis-container -- /bin/bash
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

Advertising: