Kubernetes Essentials

Core Objects

ObjectWhat it is
Podone or more containers scheduled together; the smallest unit
Deploymentkeeps N identical pods running and handles rolling updates
Servicea stable network name and load balancer for a set of pods
IngressHTTP routing from outside the cluster to services
ConfigMap / Secretconfiguration and sensitive values for pods

A Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 3
  selector:
    matchLabels: { app: api }
  template:
    metadata:
      labels: { app: api }
    spec:
      containers:
        - name: api
          image: asia-south1-docker.pkg.dev/my-project/apps/myapi:1.4.2
          ports: [{ containerPort: 8000 }]
          resources:
            requests: { cpu: 250m, memory: 256Mi }
            limits: { memory: 512Mi }

Tip: The GCP crash course covers running this on Google Kubernetes Engine (GKE).