Learn › CI/CD & DevOps

Kubernetes Concepts for Infrastructure Engineers

Kubernetes for infrastructure engineers: clusters, nodes, pods, deployments, services, ingress and storage, plus kubectl commands for troubleshooting.

Advanced 12 min read
By Gopinath Karthikeyan

Docker runs containers on one machine. Kubernetes (K8s) runs them across many machines and keeps them in the state you asked for – restarting crashed containers, spreading load and rolling out updates. If your company runs containers in production, it’s very likely on Kubernetes (often a managed service like AKS, EKS or GKE).

Lab: try it locally with kind, minikube or Docker Desktop’s built-in Kubernetes.

The big idea: desired state

You don’t tell Kubernetes “start 3 containers”. You declare “there should always be 3 replicas of this app” in a YAML file, and Kubernetes continuously works to make reality match – like a very fast, very persistent admin.

Building blocks

Object What it is Rough infra equivalent
Cluster Control plane + worker nodes The whole platform
Node A worker machine (VM) A server
Pod One or more containers that run together, the smallest unit A process group
Deployment Keeps N identical pods running; handles rolling updates A scaled service
Service Stable name and IP that load-balances to pods A virtual IP / load balancer
Ingress HTTP(S) routing from outside to services A reverse proxy
ConfigMap / Secret Config and sensitive values for pods Config files / credentials
PersistentVolume(Claim) Storage that outlives pods A disk / LUN
Namespace A logical partition of the cluster A folder / environment
Kubernetes building blocks: ingress, service, nodes, pods, deployment and control plane Ingress Routes HTTP by host or path Ingress Host/path படி HTTP routing Cluster Cluster Service Stable address, load-balances Service நிலையான address, load-balance Node 1 Node 1 Node 2 Node 2 Pod: web-1 Pod: web-1 Pod: web-2 Pod: web-2 Pod: web-3 Pod: web-3 Pod: api-1 Pod: api-1 Deployment Keeps 3 web pods running, rolls out updates Deployment 3 web pods-ஐ இயக்கும், updates rollout Control plane API server · scheduler · etcd – manages it all Control plane API server · scheduler · etcd –எல்லாவற்றையும் நிர்வகிக்கும்
Users reach an Ingress, which routes to a Service; the Service load-balances across pods that a Deployment keeps running on the nodes.Users Ingress-ஐ அடைகிறார்கள்; அது Service-க்கு அனுப்புகிறது; Service, Deployment இயக்கும் pods-க்கு load-balance செய்கிறது.

A minimal app

demo.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-web
spec:
  replicas: 3
  selector:
    matchLabels: { app: demo-web }
  template:
    metadata:
      labels: { app: demo-web }
    spec:
      containers:
        - name: web
          image: nginx:1.27
          ports: [{ containerPort: 80 }]
          resources:
            requests: { cpu: 100m, memory: 64Mi }
            limits:   { memory: 128Mi }
          readinessProbe:
            httpGet: { path: /, port: 80 }
---
apiVersion: v1
kind: Service
metadata:
  name: demo-web
spec:
  selector: { app: demo-web }
  ports: [{ port: 80, targetPort: 80 }]
kubectl apply -f demo.yaml
kubectl get deploy,pods,svc
kubectl delete pod <one-pod-name>      # watch Kubernetes replace it immediately
kubectl scale deploy demo-web --replicas=5

kubectl for troubleshooting

kubectl get pods -A                         # everything, all namespaces
kubectl get pods -n myapp -o wide           # which node each pod runs on
kubectl describe pod <pod>                  # events: scheduling, image pulls, probe failures
kubectl logs <pod>                          # container logs
kubectl logs <pod> --previous               # logs from the crashed previous run
kubectl exec -it <pod> -- sh                # shell inside the container
kubectl get events -n myapp --sort-by=.lastTimestamp
kubectl top pods -n myapp                   # CPU/memory (needs metrics-server)

Common pod states:

Status Usual cause
Pending No node has enough CPU/memory, or a volume can’t attach
ImagePullBackOff Wrong image name/tag, or no credentials for the registry
CrashLoopBackOff The app starts and crashes – check logs --previous
Running but not Ready Readiness probe failing – app not healthy yet
OOMKilled Container exceeded its memory limit

Why ops skills still matter

Kubernetes automates a lot, but someone still has to understand networking, DNS, storage, certificates, monitoring, capacity and security – the same fundamentals as the rest of this site, applied to a new platform.

FAQ

Do I need Kubernetes for a few internal apps? Usually not – Docker Compose or plain VMs are simpler. Kubernetes pays off when you run many services that need scaling and frequent deployments.

What’s next

Next: Terraform basics – infrastructure as code.

Practise this topic

Test yourself with free questions on this topic – instant answers and explanations.

Start practice questions

KubernetesContainersDevOpsAdvanced

Gopinath Karthikeyan

Gopinath Karthikeyan – Windows Site Reliability Engineer with about 12 years in enterprise Windows Server infrastructure, and founder of WinOps Academy. YouTube · LinkedIn

More in CI/CD & DevOps