Enterprise SONiC Bootcamp Register Now

Sign Up

Kubernetes Cheat Sheet

Discover essential Kubernetes commands to enhance your networking skills.
Perfect for both beginners and pros, start exploring now!

Kubernetes Cheat Sheet Commands

Cloud engineers and system administrators often turn to Kubernetes to manage complex containerized environments efficiently.

To support your workflow, we’ve compiled a detailed Kubernetes Cheat Sheet for all your orchestration needs. Say goodbye to endless searches for Kubernetes commands—this guide covers everything essential. Whether you’re deploying applications, managing clusters, or troubleshooting, this cheat sheet will be your go-to resource, just like our Docker and Helm Cheat Sheets.

Pods

Services

List all the pods in the current namespace.
Show detailed information about a specific pod.
View the logs of a specific pod.
Run a command inside a container.
Delete a specific pod.

Login into Docker
Publish an image to Docker Hub
Search Hub for an image
Pull an image from a Docker Hub
List all endpoints.

ConfigMaps

Namespaces

Create ConfigMap.
List ConfigMaps.
Delete ConfigMap.

List namespaces.
Create namespace.

Set namespace.
Delete namespace.

Nodes

Persistent Volumes

List Ingresses.
Ingress details.
Delete Ingress.

List events.
Pod logs.
Follow pod logs.

Ingress

Events and Logs

List all Ingress resources.
Show detailed Ingress configuration.
Delete specified Ingress resource.
Mark node unschedulable for pods.
Make node schedulable again.
Safely evict pods from node.

Login into Docker
Publish an image to Docker Hub
Search Hub for an image
Pull an image from a Docker Hub

Miscellaneous

Deployments

Apply config.
Delete resources.
Switch context.
Pod usage.
Node usage.
Exec command in pod.
Restart deployment.
List all resources in namespace.

Create deployment.
List deployments. 
Scale deployment.
Update image.

Rollback deployment.
Deployment status.

What is Kubernetes?

Kubernetes is an open-source platform designed to automate the deployment, scaling, and management of containerized applications. It organizes containers into logical units for easy management and scaling, across clusters of hosts. This makes it ideal for managing applications in both cloud and on-premises environments, ensuring they are reliable, scalable, and highly available. Kubernetes handles the complexity of container orchestration, allowing developers to focus on writing code rather
than managing infrastructure.

Kubernetes Tips

  • Use Namespaces: Organize resources by environment with namespaces.

    • kubectl create namespace <name>
  • Label Objects: Label objects for easy filtering.

    • kubectl get pods -l app=<label>
  • Monitor Usage: Check resource usage with kubectl top.

    • kubectl top pod <name>
  • Rolling Updates: Deploy updates without downtime.

    • kubectl set image deployment/<name> <container>=<image>
  • Set Resource Limits: Control resource allocation with limits.

    • Add requests and limits in YAML.
  • Autoscaling: Automatically scale pods based on demand.

    • kubectl autoscale deployment <name> --min=1 --max=10
  • Backup etcd: Regularly back up the etcd datastore to preserve cluster state.

GNS3 Knowledge Base

Discover a wealth of information and expert tips in our GNS3 Knowledge Base, your go-to resource for mastering network simulations. Whether you need detailed tutorials, expert tips, or troubleshooting advice, our Knowledge Base has everything to enhance your skills and solve any challenges. Dive in now to enhance your skills and troubleshoot any challenges with ease!

Share the Knowledge: Spread the Word About Our Kubernetes Cheat Sheet!

If you find this page helpful for your networking knowledge and skills, please consider sharing it with your friends, colleagues, and social media followers. Your support helps us create more valuable resources and enhance our courses.

You can share this page on your social media accounts like Facebook, LinkedIn, Twitter, and any related networking and programming forums or blogs. By sharing, you assist other networking enthusiasts in their learning journey, making their work easier and more efficient. So, if you’d like to help others, kindly share this page.

For more in-depth networking knowledge, visit our route2open courses.

Kubernetes Cheat Sheet!

Simply provide us with your name and email address, and we’ll send you our cheat sheet straight to your inbox