Image by unplash

Top Kubernetes Commands Every DevOps Engineer Should Know

Harshit Sharma
10 min readNov 28, 2024

--

A Practical Guide to Essential Kubernetes Commands for DevOps Engineers

Tip: I am using https://labs.play-with-k8s.com/ Lab to run k8s commands for demonstration.

General Commands

1. Check Cluster Info

kubectl cluster-info
  • Displays information about the cluster.
  • You might also see information about monitoring or logging tools using a managed Kubernetes cluster or one with additional services.

Output:

$ kubectl cluster-info
Kubernetes control plane is running at https://192.168.0.23:6443
CoreDNS is running at https://192.168.0.23:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

2. List Nodes

kubectl get nodes
  • Lists all nodes in the cluster.

Output:

NAME    STATUS   ROLES           AGE    VERSION
node1 Ready control-plane 2m4s v1.27.2

3. Show Resource Status

kubectl get all
  • Displays all resources in the current namespace.
  • By using “-n <Namespace>” you can also check…

--

--

Harshit Sharma
Harshit Sharma

Written by Harshit Sharma

A DevOps & SRE Engineer Exploring and growing in the world of tech every day 🌱🚀

No responses yet