Tool cheatsheet
Kubernetes manifests Cheatsheet
YAML for the Kubernetes resources you write most: Deployments, Services, Ingress, config, storage, probes, scaling and access control.
Workloads
- Deployment — Run three replicas of a container and roll out updates gradually.
- Set resource requests and limits — Request what a container needs for scheduling, and cap what it can use.
- Add health probes — Use readiness to control traffic and liveness to restart a stuck container.
- Pass configuration as environment variables — Load a ConfigMap and read one key from a Secret into environment variables.
- Harden a container — Run as a non-root user with a read-only filesystem and no extra privileges.
- Run setup before the app starts — Run a container to completion before the main containers start.
- Job — Run a task to completion, retrying on failure.
- CronJob — Run a Job on a schedule. This one runs daily at 02:00.
Services and Ingress
- Service (internal) — Give pods a stable internal address and spread traffic across them.
- Service (public load balancer) — Ask the cloud provider for an external load balancer.
- Ingress with TLS — Route a host name to a Service and terminate TLS with a certificate Secret.
- Deny all ingress traffic by default — Block all incoming traffic to pods in a namespace, then allow what you need.
Config and storage
- Namespace — Create a namespace to group resources.
- ConfigMap — Store non-secret configuration.
- Secret — Store sensitive values. stringData accepts plain text, which Kubernetes encodes. Secrets are only base64-encoded unless you enable encryption at rest.
- PersistentVolumeClaim — Request storage that outlives a pod.
- Mount a volume — Mount a claim into a container.
Scaling and access control
- Autoscale on CPU — Scale a Deployment between 2 and 10 replicas to keep CPU near 70%. Needs metrics-server.
- PodDisruptionBudget — Keep at least two pods available during voluntary disruptions such as node drains.
- ServiceAccount — Give pods an identity for API access.
- Role and RoleBinding — Allow a service account to read pods in one namespace.
- Schedule onto matching nodes — Require nodes with a label, and tolerate a taint.
Related cheatsheets
- Ansible 2 cheatsheet — Run ad-hoc commands and playbooks, manage inventories, roles, collections and secrets with Ansible.
- Argo CD 3 cheatsheet — Install Argo CD, define Applications declaratively, and manage sync, diffs, history and rollbacks with the argocd CLI.
- AWS CLI 2 cheatsheet — Configure credentials and manage S3, EC2, Lambda, logs, containers and secrets with the AWS CLI v2.
- Azure CLI 2 cheatsheet — Sign in and manage resource groups, VMs, web apps, storage, Kubernetes, registries and secrets with the az command.
- Bash and Linux 5 cheatsheet — Everyday shell and Linux commands for files, searching text, permissions, processes and servers.
- Claude API cheatsheet — Call Claude from Python, TypeScript or curl: messages, streaming, thinking, tools, structured output, caching, batches and error handling.