🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Kubernetes Commands: kubectl get – Tutorials and Examples

Listing and Inspecting your cluster, pods, services and more.

kubectl cluster-info

review status and roles

kubectl get nodes

Additional information about each node in the cluster.

kubectl get nodes -o wide

Let’s get a list of pods…but there isn’t any running

kubectl get pods

True, but let’s get a list of system pods. A namespace is a way to group resources together.

kubectl get pods –namespace kube-system

Let’s get additional information about each pod.

kubectl get pods –namespace kube-system -o wide

Now let’s get a list of everything that’s running in all namespaces

kubectl get all –all-namespaces | more

Let’s look at the headers in each column. Name, Alias/shortnames, API Group (or where that resource is in the k8s API Path),

Is the resource in a namespace, for example StorageClass issn’t and is available to all namespaces and finally Kind…this is the object type.

kubectl api-resources | head -n 10

We can easily filter using group

kubectl api-resources | grep pod

Explain an indivdual resource in detail

kubectl explain pod | more
kubectl explain pod.spec | more
kubectl explain pod.spec.containers | more

You’ll soon find your favorite alias

kubectl get no

Let’s take a closer look at our nodes using Describe

Check out Name, Taints, Conditions, Addresses, System Info, Non-Terminated Pods, and Events

kubectl describe nodes c1-master1
kubectl describe nodes c1-node1

Ok, so now that we’re tired of typing commands out, let’s enable bash auto-complete of our kubectl commands

sudo apt-get install bash-completion
echo “source <(kubectl completion bash)” >> ~/.bashrc
source ~/.bashrc
kubectl g[tab][tab] po[tab][tab] –all[tab][tab]
kubectl -h | more
kubectl get -h | more
kubectl describe -h | more

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.