Difference between revisions of "Kubectl exec"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 3: Line 3:
 
  [[kubectl exec --stdin --tty]] or [[kubectl exec -it]]
 
  [[kubectl exec --stdin --tty]] or [[kubectl exec -it]]
 
  [[kubectl exec --help]]
 
  [[kubectl exec --help]]
 +
 +
 +
kubectl exec -it ubuntu -- bash
 +
 
  kubectl exec [[--tty]] -i redis-client --namespace default [[--]] [[bash]]
 
  kubectl exec [[--tty]] -i redis-client --namespace default [[--]] [[bash]]
  

Revision as of 06:56, 28 March 2023

kubectl exec
kubectl exec --stdin --tty or kubectl exec -it
kubectl exec --help


kubectl exec -it ubuntu -- bash
kubectl exec --tty -i redis-client --namespace default -- bash

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 -n your_namespace exec your-pod-name1 -- bash
kubectl exec -it -c your-pod-name-3 bash
error: you must specify at least one command for the container
Error: unable to upgrade connection: container not found
Error from server (NotFound): pods "your-pod-name" not found


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
kubectl exec -it your-container-name -- bash
Defaulted container "yourapp-rabbitmq" out of: yourapp-rabbitmq, yourapp-rabbitmq-metrics

Related

Activities

See also

Advertising: