Cheat SheetsKubernetesWorkloads

Workloads — Cheat Sheet

Kubernetes · 1 topics. Download the PDF or the Instagram carousel and share it.

Cheat Sheet · AiCanCode.org
Workloads
Kubernetes1 topicsQuick revision reference
1

Pods, Deployments & ReplicaSets

A Pod is the smallest deployable unit in Kubernetes. A Deployment manages a set of identical Pods via a ReplicaSet, handling rolling updates, rollbacks, and self-healing.

  • Pod is the smallest K8s unit — one or more containers sharing a network namespace.
  • Never create bare Pods in production — use Deployments so K8s can self-heal them.
  • Deployment → ReplicaSet → Pods: Deployment manages update strategy; ReplicaSet manages replica count.
  • resource.requests: what the pod is guaranteed; resource.limits: the hard cap.
  • RollingUpdate with maxUnavailable: 0 ensures zero downtime — K8s creates new pods before killing old.
  • Rollback is instant and free — K8s keeps old ReplicaSets and just shifts the replica count.
pod.yaml — Pod manifest
# pod.yaml — you rarely create pods directly, but good to understand

apiVersion: v1

kind: Pod

metadata:

  name: my-app

  labels:

    app: my-app

    version: v1.2.3

spec:

  containers:

    - name: app

      image: myregistry/my-app:v1.2.3

      ports:

        - containerPort: 8080

      env:

        - name: LOG_LEVEL

          value: "info"

      resources:

        requests:             # guaranteed minimum (scheduler uses this)

          memory: "128Mi"

          cpu: "250m"         # 250 millicores = 0.25 CPU

        limits:               # hard maximum (OOM kill / CPU throttle)

          memory: "512Mi"

          cpu: "1000m"        # 1000m = 1 full CPU core

      readinessProbe:

        httpGet:

          path: /health

          port: 8080

        initialDelaySeconds: 5

        periodSeconds: 10

      livenessProbe:

        httpGet:

          path: /health

          port: 8080

        initialDelaySeconds: 15

        failureThreshold: 3



# kubectl apply -f pod.yaml

# kubectl get pods

# kubectl describe pod my-app

# kubectl delete pod my-app
Learn this free with Aria, your AI tutor → AiCanCode.org/learn/kubernetes