Kubernetes & kubectl cheat sheets

Kubernetes runs containerized workloads across a cluster, and kubectl is the command-line client for its API. Everything you do with kubectl falls into three buckets: commands that create and inspect, resources (the objects like Pods and Deployments you manage), and troubleshooting when something is not working. Commands is the imperative fast path — run, get, describe, logs, exec, apply, delete. Resources is the object model plus a working Deployment YAML. Troubleshooting is the debugging loop — events, describe, logs, exec, rollouts.

Every command is verified against the official Kubernetes documentation and behaves the same on any cluster you point kubectl at — managed (EKS, GKE, AKS) or self-hosted. Two facts worth knowing up front: kubectl top only works if the Metrics Server add-on is installed, and kubectl get all does not actually return every resource type.

Cheat sheets

Network tools

Subnet CalculatorIPv6 CalculatorWildcard MaskRange → CIDRSplitterAggregatorVLSM CalculatorPracticeCheat Sheet

FAQ

What is Kubernetes?

Kubernetes (K8s) is an open-source system for automating the deployment, scaling and operation of containerized applications. It schedules containers onto nodes, keeps the desired number running, restarts failures, rolls out updates, and manages networking and storage. You describe what you want in YAML, and Kubernetes works to keep the cluster matching that state.

What is kubectl?

kubectl is the command-line client that talks to a Kubernetes cluster's API server. Every get, create, apply, describe, logs and exec in these sheets is a kubectl command. It reads the cluster connection details from a kubeconfig file (view and switch with kubectl config get-contexts and use-context).

What is the difference between kubectl run and kubectl create deployment?

kubectl run creates a single Pod (or can create a Deployment with the right flags). kubectl create deployment creates a Deployment, which manages a set of replicas and handles rolling updates. For anything long-running, use a Deployment; for a quick one-off command or probe, a bare pod via run is fine.

Where should I start with Kubernetes?

Start with the resources sheet to learn the object model, then the commands sheet for the daily verbs, and keep the troubleshooting sheet open until the status-code field guide becomes second nature. The official Kubernetes documentation's 'Kubernetes Basics' tutorial is the best free deep dive.