Quick remote shell in Kubernetes Cluster
How to quickly debug anything on cluster? You can quickly run any linux oci image using kubectl
:
Jak szybko zdebugować coś na klastrze? Nic trudnego wystarczy odpalić poda na zdalnej maszynie przy wykorzystaniu kubectl
:
kubectl run shell --rm -i --tty --image ubuntu -- bash
kubectl run
- Create and run a particular image in a pod.shell
- pod name --rm
- delete resources created in this command for attached containers.-i
- Keep stdin open on the container(s) in the pod, even if nothing is attached. --tty
- Allocated a TTY for each container in the pod. --image
- The image for the container to run. ubuntu
- ubuntu image name-- bash
- command to run.
And that is it :) After disconnecting pod should be automatically removed!