mediumDevOps EngineerCloud
Explain Kubernetes core concepts — Pods, Deployments, and Services
Posted 18/04/2026
by Mehedy Hasan Ador
Question Details
"We're moving from Docker Compose to K8s. Explain the core resources."
Suggested Solution
Hierarchy
Deployment → ReplicaSet → Pod(s) → Container(s), Service → routes to Pod(s)Deployment (manages Pods)
apiVersion: apps/v1
kind: Deployment
spec:
replicas: 3
selector: { matchLabels: { app: interviewos } }
template:
spec:
containers: [{ name: web, image: interviewos:latest, ports: [{ containerPort: 3000 }] }]
Service (networking)
kind: Service
spec:
selector: { app: interviewos }
type: LoadBalancer
ports: [{ port: 80, targetPort: 3000 }]