Site icon Narayana Tutorial

Kubernetes POD Commands

Here we are sharing the topmost important Kubernetes PODs-related commands like get Pods list, Pods description, restart Pods, log Pod, delete Pod, describe Pod, and watch Pod.

 

PODs

By using this command, we can get the list of pods exists in the namespace.

kubectl get pods

 

POD

By Using this command, we can get the single pod in the name space.

 kubectl get pod <pod-name>

 

POD in yaml

By using this command, we can get the pod configuration in yaml in the name space.

kubectl get pod <pod-name> -o yaml

 

POD Wide Information.

By using this command, we can get the pod wide information in the name space.

kubectl get pod <pod-name> -o wide

 

POD with watch

By using this command, we can get the pod with watch in the name space.

kubectl get pod <pod-name>

 

POD Describe

By using this command, we can get the pod description in the name space.

Kubectl describe pod <pod name>

 

POD Edit

By using this command, we can edit pod in the name space.

Kubectl edit pod <pod-name>

 

POD Delete

By using this command, we can delete the pod in the name space.

Kubectl delete pod <pod-name>

 

POD Logs

By using this command, we can get the pod logs in the name space.

Kubectl logs pod <pod name>

 

POD Live Logs View

By using this command, we can get the pod live logs in the name space.

Kubectl logs pod -f <pod-name>

 

Access/Jump into POD

By using this command, we can jump into pod in the name space.

kubectl exec -it pod <pod-name> /bin/bash

 

Running Temporary Image

By using this command, we can get the running temporary image in the name space.

kubectl run <pod-name> --image=curl-images/curl --rm -it -- restart=Never -- curl <destination>