lesson

Kubernetes Fundamentals

Pods, Deployments, Services, Ingress, and ConfigMaps — the core K8s building blocks.

Kubernetes Fundamentals

Core Concepts

Pod

The smallest deployable unit. Contains one or more containers that share networking and storage.

apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
  - name: app
    image: myapp:1.0
    ports:
    - containerPort: 8080

Deployment

Manages a set of identical Pods. Handles rolling updates and rollbacks.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: app
        image: myapp:1.0
        resources:
          requests: { cpu: "100m", memory: "128Mi" }
          limits:   { cpu: "500m", memory: "256Mi" }

Service

Stable network endpoint for a set of Pods.

TypeDescription
ClusterIPInternal only (default)
NodePortExposes on each node's IP
LoadBalancerCreates cloud LB (AWS ALB, GCP LB)

Ingress

Routes external HTTP traffic to Services based on hostname/path.


Interview Must-Knows

  • Liveness vs readiness probes: liveness = restart if unhealthy, readiness = stop routing traffic if not ready
  • Resource requests vs limits: requests = guaranteed, limits = maximum. Set both.
  • Rolling update strategy: maxSurge + maxUnavailable control how many pods update at once
  • Namespaces: logical isolation (dev, staging, prod in same cluster)
  • ConfigMaps/Secrets: external configuration, not baked into images
  • Sign in to use the AI study buddy on this lesson.

    Resources