Explore Courses
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Birla Institute of Management Technology Birla Institute of Management Technology Post Graduate Diploma in Management (BIMTECH)
  • 24 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Popular
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science & AI (Executive)
  • 12 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
University of MarylandIIIT BangalorePost Graduate Certificate in Data Science & AI (Executive)
  • 8-8.5 Months
upGradupGradData Science Bootcamp with AI
  • 6 months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
OP Jindal Global UniversityOP Jindal Global UniversityMaster of Design in User Experience Design
  • 12 Months
Popular
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Rushford, GenevaRushford Business SchoolDBA Doctorate in Technology (Computer Science)
  • 36 Months
IIIT BangaloreIIIT BangaloreCloud Computing and DevOps Program (Executive)
  • 8 Months
New
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Popular
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
Golden Gate University Golden Gate University Doctor of Business Administration in Digital Leadership
  • 36 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
Popular
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
Bestseller
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
IIIT BangaloreIIIT BangalorePost Graduate Certificate in Machine Learning & Deep Learning (Executive)
  • 8 Months
Bestseller
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in AI and Emerging Technologies (Blended Learning Program)
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
ESGCI, ParisESGCI, ParisDoctorate of Business Administration (DBA) from ESGCI, Paris
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration From Golden Gate University, San Francisco
  • 36 Months
Rushford Business SchoolRushford Business SchoolDoctor of Business Administration from Rushford Business School, Switzerland)
  • 36 Months
Edgewood CollegeEdgewood CollegeDoctorate of Business Administration from Edgewood College
  • 24 Months
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with Concentration in Generative AI
  • 36 Months
Golden Gate University Golden Gate University DBA in Digital Leadership from Golden Gate University, San Francisco
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Deakin Business School and Institute of Management Technology, GhaziabadDeakin Business School and IMT, GhaziabadMBA (Master of Business Administration)
  • 12 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science (Executive)
  • 12 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityO.P.Jindal Global University
  • 12 Months
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (AI/ML)
  • 36 Months
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDBA Specialisation in AI & ML
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
New
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGrad KnowledgeHutupGrad KnowledgeHutAzure Administrator Certification (AZ-104)
  • 24 Hours
KnowledgeHut upGradKnowledgeHut upGradAWS Cloud Practioner Essentials Certification
  • 1 Week
KnowledgeHut upGradKnowledgeHut upGradAzure Data Engineering Training (DP-203)
  • 1 Week
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
Loyola Institute of Business Administration (LIBA)Loyola Institute of Business Administration (LIBA)Executive PG Programme in Human Resource Management
  • 11 Months
Popular
Goa Institute of ManagementGoa Institute of ManagementExecutive PG Program in Healthcare Management
  • 11 Months
IMT GhaziabadIMT GhaziabadAdvanced General Management Program
  • 11 Months
Golden Gate UniversityGolden Gate UniversityProfessional Certificate in Global Business Management
  • 6-8 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
IU, GermanyIU, GermanyMaster of Business Administration (90 ECTS)
  • 18 Months
Bestseller
IU, GermanyIU, GermanyMaster in International Management (120 ECTS)
  • 24 Months
Popular
IU, GermanyIU, GermanyB.Sc. Computer Science (180 ECTS)
  • 36 Months
Clark UniversityClark UniversityMaster of Business Administration
  • 23 Months
New
Golden Gate UniversityGolden Gate UniversityMaster of Business Administration
  • 20 Months
Clark University, USClark University, USMS in Project Management
  • 20 Months
New
Edgewood CollegeEdgewood CollegeMaster of Business Administration
  • 23 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
KnowledgeHut upGradKnowledgeHut upGradBackend Development Bootcamp
  • Self-Paced
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 5 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
upGradupGradDigital Marketing Accelerator Program
  • 05 Months

Kubernetes Cheat Sheet: Architecture, Components, Command Sheet

Updated on 26 September, 2022

13.06K+ views
6 min read

Kubernetes has become an essential part of industries and is changing the world of technology. Janet Kuo, the co-chair of KubeCon, addressed the Kubernetes features and its importance in the coming time. She talks about the Kubernetes extensions and solutions that will change the world.

This cheat sheet will provide a reference to working professionals in the implementation of Kubernetes. It contains all the necessary details to help beginners who are new to Kubernetes. The Kubernetes Cheat Sheet is a quick and handy medium to refer to all the essential concepts and commands of Kubernetes.

Enrol for the Machine Learning Course from the World’s top Universities. Earn Masters, Executive PGP, or Advanced Certificate Programs to fast-track your career.

About Kubernetes

An open-source platform for automatic deployment and scaling containers across the clusters of hosts to provide container-centric infrastructure is known as Kubernetes (also known as “Kube” or k8s). It allows easy and efficient management of different hosts running Linux containers by clustering them. 

Kubernetes is a platform that is designed for managing the life cycle of containerized applications and services completely. A Kubernetes user can define the ways in which an application should run and interact with different applications.

Users can switch traffic between different versions of applications, perform updates, scale up and down the services, etc. with Kubernetes. It offers users a high degree of flexibility, reliability, and power in managing applications.

Some of the major features of Kubernetes are:

  • Maximize resources by making better use of hardware.
  • A container orchestrator across multiple hosts.
  • Automate the deployment process and updates.
  • Able to run a Linux container.
  • Auto-scaling helps in launching containers on cluster nodes.
  • Scaling up and down as required.
  • Self-healing by replacing, rescheduling, and restarting the dead containers.
  • Automated rollbacks and rollouts.
  • Load balancing and service discovery.
  • Auto-restart, auto-placement, and auto-replication, etc. 

Read: Deep Learning Algorithm

Architecture of Kubernetes

The architecture of Kubernetes consists of layers: Higher and lower layers. The complexity of abstracting the higher layer can be found in the lower layers. The individual physical or virtual machines are brought together into a cluster. A shared network is used for communication between each server. So, just like other distributed platforms, Kubernetes has one master (at least), and multiple compute nodes.

  • The master of Kubernetes schedules the deployments, exposes the API and manages the overall Kubernetes cluster.
  • The node runs a container runtime, agent for communicating with the master, and other monitoring components, logging, etc.

Components of Kubernetes architecture

Let’s have a look at the purpose and components of master and nodes in the Kubernetes architecture.

Master

The master maintains the desired state of the cluster. Since it manages the whole cluster, it is called master. It contains:

  • API server: Kubernetes API server
  • Scheduler: Used for pod scheduling in worker nodes
  • Controller: Manages pod replication
  • Etcd: A metadata service

Nodes

It contains necessary services that are important for running the pods. The master manages the nodes. It is also called Minion. It contains:

  • Pod: Group of containers
  • Docker: Container-based technology, user space of OS.
  • Kubelet: Container agents that are responsible for maintaining the set of pods.
  • Kube-proxy: Routes traffic coming into a node from the service

Now, let’s understand the important commands of Kubernetes.

Kubectl Commands

Kubectl is the command-line tool for Kubernetes. The basic Kubectl commands can be divided into:

  • Pod and Container Introspection
  • Cluster Introspection
  • Debugging
  • Quick Commands
  • Objects

Pods and Container Introspection

Functionality Command
For describing pod names Kubectl describe pod<name>
For listing all current pods Kubectl get pods
For listing all replication controllers Kubectl get rc
For showing the replication controller name Kubectl describe rc <name>
For listing replication controllers in a namespace Kubectl get rc –namespace=”namespace”
For showing a service name Kubectl describe svc<name>
For listing services Kubectl get cvc
For watching nodes continuously. Kubectl get nodes -w
For deleting a pod Kubectl delete pod<name>

 Cluster Introspection

Functionality Command
For getting version-related information Kubectl version
For getting configuration details Kubectl config g view
For getting cluster-related information Kubectl cluster-info
For getting information about a node Kubectl describe node<node>

Debugging Commands

Functionality Command
For displaying metrics for a pod Kubectl top pod
For displaying metrics for a node Kubectl top node
For watching Kubelet logs Watch -n 2 cat/var/log/kublet.log
For getting logs from the service for the container Kubectl logs -f<name>>[-c< $container>]
For the execution of the command on service by selecting a container Kubectl exec<service><commands>[-c< $container>]

Quick Commands

The below quick commands are often used and hence, very useful.

Functionality Command
For launching a pod with a name and an image. Kubectl run<name> — image=<image-name>
For creating a service described in <manifest.yaml> Kubectl create -f <manifest.yaml>
For scaling the replication counter to count the number of instances. Kubectl scale –replicas=<count>rc<name>
For mapping the external port to the internal replication port. Expose rc<name> –port=<external>–target-port=<internal>
For stopping all pods in <n> Kubectl drain<n>– delete-local-data–force–ignore-daemonset
For creating a namespace. Kubectl create namespace <namespace>
For allowing the master node to run pods. Kubectltaintnodes –all-node-role.kuernetes.io/master-

Objects

Some of the familiar objects used in Kubernetes are as follows:

List of Common Objects
All Controller revisions
cm= conf gmaps Cluster role bindings
Cronjobs cs=component statuses
Deploy=deployments limits=limit ranges
ev= events hpa= horizontal pod autoscaling
jobs ds= daemon sets
No = nodes ns= namespaces
po= pods Pod preset
Psp= pod security policies Pv= persistent volumes
quota= resource quotas rs= replica sets
roles rc= replication controllers
sc= storage classes pdb= pod distribution budgets
clusterroles secrets
crd=custom resource definition Pod templates
csr= certificate signing requests sa= service accounts
Netpol- network policies Role bindings
ing= ingress pvc= persistent volume claims
ep=end points sts= stateful sets

Also Read: Regularization in Deep Learning

Kubernetes Command Cheat Sheet

All the basic information about Kubernetes, it’s architecture and commands are shown in below Kubernetes cheat sheet:

If you’re interested to learn more about deep learning techniques, machine learning, check out IIIT-B & upGrad’s PG Diploma in Machine Learning & AI which is designed for working professionals and offers 450+ hours of rigorous training, 30+ case studies & assignments, IIIT-B Alumni status, 5+ practical hands-on capstone projects & job assistance with top firms.

Frequently Asked Questions (FAQs)

1. What is Kubernetes?

Kubernetes is an open-source platform for automating deployment, scaling, and management of containers. A container is a ready-to-run software package that contains everything required to run the application: code, runtime environment, application, and system libraries. The containers are like logical units of application, and when Kubernetes groups them, it becomes easy to manage and discover the containers. These containers are deployed and scaled across hosts to provide a container-centric infrastructure. In short, it is a platform that manages the entire lifecycle of containerized applications.

2. What are the main components of Kubernetes architecture?

There are two main components in the Kubernetes architecture- master node and worker node. A node is the main worker machine which is important for running a group of clusters called pods. The whole cluster is managed by the master node, whereas the worker node performs the tasks assigned by the master node. These nodes have many inbuilt components within them. The master node contains Kubernetes API Server, Kubernetes Scheduler, Kubernetes Controller, and Etcd. The worker node has pod, docker, kubelet, and kube-proxy.

3. What do kubelet and kube-proxy do?

Kubelet, which is present in every node, ensures that containers are running well in a pod. It does so by taking a set of PodSpecs provided mainly through apiserver and checking the containers present in those PodSpecs. A PodSpec is a YAML or JSON object that describes a pod. Kubernetes Network Proxy, also known as kube-proxy, maintains network rules on nodes. Communication from network sessions inside or outside the cluster to pods is possible through these network rules. Kube-proxy forwards the traffic if the OS packet filtering layer is not available.