Cheatsheets

Quick reference guides for Kubernetes commands, YAML structures, and common operations. These cheatsheets are designed to be printed, bookmarked, or kept open in a terminal window for instant access to the commands and syntax you need most often.

What Are Cheatsheets?

Cheatsheets are condensed reference cards that provide essential information at a glance. Unlike full documentation, cheatsheets focus on the most frequently used commands, patterns, and syntax—perfect for when you know what you want to do but need a quick reminder of the exact syntax.

graph TB A[Cheatsheets] --> B[kubectl Commands] A --> C[YAML Templates] A --> D[API Resources] A --> E[Troubleshooting] A --> F[Common Patterns] B --> B1[Get, Describe, Logs] C --> C1[Pod, Service, Deployment] D --> D1[Resource Types] E --> E1[Debug Commands] F --> F1[Quick Solutions] style A fill:#e1f5ff style B fill:#fff4e1 style C fill:#e8f5e9 style D fill:#f3e5f5 style E fill:#ffe1e1 style F fill:#fff4e1

Cheatsheet Categories

kubectl Commands

Essential kubectl commands for daily operations:

  • Resource Management - Get, create, delete, and update resources
  • Pod Operations - Exec, logs, port-forward, and debugging
  • Namespace Management - Creating and switching contexts
  • Label & Selector - Filtering and querying resources
  • Output Formats - JSON, YAML, custom columns, and wide output
  • Context & Config - Managing kubeconfig and contexts
  • Apply & Patch - Updating resources safely
  • Watch & Events - Monitoring resource changes

YAML Templates

Ready-to-use YAML templates for common resources:

  • Pod Templates - Basic pods, init containers, sidecars
  • Deployment Templates - Rolling updates, strategies, replicas
  • Service Templates - ClusterIP, NodePort, LoadBalancer, Headless
  • ConfigMap & Secret - Configuration and secret definitions
  • PersistentVolume & PVC - Storage resource templates
  • Ingress Templates - Basic and TLS ingress configurations
  • RBAC Templates - Roles, RoleBindings, ServiceAccounts
  • Job & CronJob - One-time and scheduled job templates
  • StatefulSet & DaemonSet - Stateful and daemon workload templates
  • NetworkPolicy - Network security policy templates

API Resources

Quick reference for Kubernetes API resources:

  • Core Resources - Pods, Services, Namespaces, Nodes
  • Workload Resources - Deployments, ReplicaSets, StatefulSets, Jobs
  • Service Resources - Services, Ingress, Endpoints
  • Storage Resources - PVs, PVCs, StorageClasses
  • Config Resources - ConfigMaps, Secrets
  • RBAC Resources - Roles, RoleBindings, ClusterRoles
  • Policy Resources - NetworkPolicies, PodSecurityPolicies
  • Custom Resources - CRDs and their usage

Troubleshooting Commands

Essential commands for debugging and troubleshooting:

  • Pod Debugging - Describe, logs, exec, events
  • Node Debugging - Node status, resource usage, conditions
  • Network Debugging - Service endpoints, DNS resolution, connectivity
  • Storage Debugging - Volume mounts, PVC status, storage classes
  • Event Inspection - Viewing and filtering events
  • Resource Inspection - Getting detailed resource information
  • API Server Debugging - Checking API availability and versions

Common Patterns

Quick reference for frequently used patterns:

  • Label Selectors - Common selector patterns
  • Field Selectors - Filtering by resource fields
  • JSONPath Queries - Extracting specific data
  • Port Forwarding - Accessing services locally
  • File Operations - Copying files to/from pods
  • Resource Quotas - Setting limits and requests
  • Affinity Rules - Node and pod affinity patterns
  • Taints & Tolerations - Node scheduling rules

Helm Commands

Quick reference for Helm operations:

  • Chart Operations - Install, upgrade, uninstall
  • Release Management - List, status, history, rollback
  • Template Commands - Render, lint, validate
  • Repository Management - Add, update, search charts
  • Value Overrides - Setting and using values

Kustomize Commands

Quick reference for Kustomize operations:

  • Build Commands - Building and previewing overlays
  • Overlay Patterns - Common overlay structures
  • Patch Operations - Strategic merge and JSON patches
  • Resource Generation - ConfigMap and Secret generators

Cheatsheet Features

Each cheatsheet includes:

Command syntax - Exact command format with options
Common flags - Most frequently used flags and their meanings
Examples - Real-world usage examples
Shortcuts - Aliases and time-saving tips
Output formats - Different ways to view results
Print-friendly - Designed to be printed or saved as PDF

How to Use Cheatsheets

  1. Bookmark favorites - Save the cheatsheets you use most often
  2. Print for reference - Keep printed copies at your desk
  3. Terminal tabs - Keep cheatsheet pages open while working
  4. Mobile access - Access on your phone for quick lookups
  5. Team sharing - Share relevant cheatsheets with your team

Cheatsheet Format

Each cheatsheet follows a consistent structure:

# [Category] Cheatsheet

## [Section]
Command/Pattern | Description | Example
----------------|-------------|--------
kubectl get pods | List pods | kubectl get pods -n production

## Quick Tips
- Tip 1
- Tip 2

## Common Flags
--flag | Description

Coming Soon

We’re continuously expanding our cheatsheet collection. Upcoming cheatsheets include:

  • Service mesh commands (Istio, Linkerd)
  • GitOps tools (ArgoCD, Flux)
  • Cloud provider CLI commands (AWS, GCP, Azure)
  • Security scanning tools
  • Monitoring and observability tools
  • Advanced kubectl plugins