kubectl useful commands that developers should know.

To control Kubernetes developer uses the kubectl command. kubectl is a command-line tool. Following are some really useful command for kubectl to control Kubernetes clusters.

Once we are set with kubectl and properly connected with Kubernetes clusters, we will be able to run the following commands:

Show the kubectl config:

$ kubectl config view

Show running pods with age:

$ kubectl get pods

Show logs of a running pod:

$ kubectl logs <podname>

Upsacle a pod to have 3 replicas:

$ kubectl scale deployments <podname> --replicas=3

Downscale a pod to stop all replicas:

$ kubectl scale deployments <podname> --replicas=0
Share