মূল বিষয়বস্তুতে যান

এই পেজের মূল বিষয়বস্তু ইংরেজিতে।এই পেজ অনুবাদ করুন

দক্ষতা ও প্রযুক্তি

Docker & Kubernetes roadmap

Learn containers with Docker, then orchestration with Kubernetes, the standard way to deploy modern applications.

সময়
⏱ 4–6 weeks
Level
Intermediate
Steps
5 steps
Architecture ↓Cheat sheet ↓5 interview Q&As ↓
শেয়ার

The roadmap

Click a step to open the full guide.

Best architecture: a Kubernetes deployment

How traffic and workloads flow through a production cluster.

Kubernetes request path

  1. DNS
  2. Cloud load balancer
  3. Ingress controller (TLS)
  4. Service
  5. Pods (Deployment, HPA)
  6. ConfigMaps / Secrets / volumes

Why it's built this way

  • Deployments + HPA keep the right number of healthy pods.
  • Ingress handles HTTP routing and TLS.
  • Probes, requests and limits on every container.
  • GitOps keeps the cluster in sync with Git.

Docker & Kubernetes cheat sheet

The essentials on one screen. Bookmark it for revision.

Docker

Builddocker build -t app:1.0 .
Rundocker run -d -p 8000:8000 app:1.0
Listdocker ps / docker images
Logsdocker logs -f <container>
Shell insidedocker exec -it <container> sh
Compose updocker compose up -d --build
Clean updocker system prune

kubectl

Applykubectl apply -f k8s/
Podskubectl get pods -o wide
Describekubectl describe pod <name>
Logskubectl logs -f <pod>
Scalekubectl scale deploy/app --replicas=3
Rollbackkubectl rollout undo deploy/app
Port-forwardkubectl port-forward svc/app 8000:80

Improve performance

  • Use small images (slim/distroless, multi-stage) for faster pulls and starts.
  • Set realistic CPU/memory requests so the scheduler packs pods well.
  • Autoscale with HPA and the cluster autoscaler.
  • Use readiness probes so traffic only reaches warmed-up pods.
  • Cache dependencies in CI builds to speed up pipelines.

Security checklist

  • Run containers as a non-root user with a read-only filesystem where possible.
  • Scan images for vulnerabilities and use trusted, minimal base images.
  • Never bake secrets into images; use Kubernetes Secrets or a secrets manager.
  • Use RBAC with least privilege and network policies to limit pod-to-pod traffic.
  • Keep clusters and images patched; pin image versions.

Most important interview questions

Click a question to see a strong answer. Each step also has its own questions.

1What problem does Kubernetes solve?

Running containers reliably across many machines: scheduling, self-healing, scaling, service discovery, rolling updates and configuration.

2Explain Docker image layers.

Each Dockerfile instruction creates a cached, read-only layer; changing one step rebuilds it and the steps after it.

3Deployment vs StatefulSet?

Deployments are for stateless, interchangeable pods. StatefulSets give pods stable names and storage, for databases and similar stateful apps.

4How do pods find each other?

Through Services, which provide stable DNS names (e.g. api.default.svc.cluster.local) and load-balance across pods.

5When is Kubernetes overkill?

For small apps or teams; managed container services or serverless are simpler and cheaper until you need Kubernetes' flexibility.

Relatedটি রোডম্যাপ

1

Docker & Kubernetes · Step 1 of 5 · 1 week

Containers and images

What Docker is and why it matters.

A container packages your app with everything it needs, so it runs the same on your laptop and in production. A Dockerfile is the recipe for an image.

What you'll learn

  • Images vs containers
  • Dockerfiles
  • Layers and caching
  • Ports and volumes
  • Registries

Image layers (top changes most)

  1. Your code (COPY . .)
  2. Dependencies (pip install)
  3. Language runtime (Python)
  4. Base OS (slim Debian)

Key concepts

Image
A read-only template (app + dependencies).
Container
A running instance of an image, isolated from others.
Layer cache
Unchanged Dockerfile steps are reused, so builds get faster.

Step by step

  1. 1.1

    Install Docker

    Docker Desktop or Docker Engine; run docker run hello-world.

  2. 1.2

    Write a Dockerfile

    Base image → copy deps → install → copy code → start command.

  3. 1.3

    Build and run

    docker build -t app . then docker run -p 8000:8000 app.

  4. 1.4

    Shrink it

    Slim base images, multi-stage builds, .dockerignore.

FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Notes

  • Order Dockerfile steps from least to most frequently changed for faster builds.

Tips & tricks

  • Use slim base images and multi-stage builds.

Interview questions

Container vs virtual machine?

VMs virtualise hardware and run a full OS each. Containers share the host kernel and isolate processes, so they're much lighter and start in seconds.

How do you make Docker builds faster?

Order steps from least to most changing (copy dependency files and install before copying code), use .dockerignore, slim bases and multi-stage builds.

The quick way to study this

Write a Dockerfile for one of your apps today.

2

Docker & Kubernetes · Step 2 of 5 · 4 days

Docker Compose

Run multi-container apps.

Compose starts your app, database and cache together with one command. It is perfect for local development.

What you'll learn

  • compose.yaml
  • Networks
  • Volumes for databases
  • Environment variables
  • Health checks

A local dev stack with Compose

compose.yaml
  • api (FastAPI)
  • db (PostgreSQL)
  • cache (Redis)
  • worker (jobs)

Key concepts

Docker Compose
Run multi-container apps with one command.
আয়তন
Storage that survives container restarts.
Network
Services reach each other by name (e.g. db:5432).

Step by step

  1. 2.1

    Define services

    App, database and cache in compose.yaml.

  2. 2.2

    Persist data

    Named volumes for database files.

  3. 2.3

    Configure

    Environment variables and an .env file kept out of Git.

Notes

  • Never put real secrets in compose files committed to Git.

Tips & tricks

  • Use named volumes so database data survives restarts.

Interview questions

Why does data disappear when a container is removed, and how do you fix it?

Container filesystems are temporary. Store data in volumes (or external managed databases) so it persists.

The quick way to study this

Run your API with PostgreSQL and Redis using Compose.

3

Docker & Kubernetes · Step 3 of 5 · 1 week

Kubernetes basics

Pods, deployments and services.

Kubernetes runs containers across many machines, restarts failed ones and scales them. You describe the desired state in YAML and Kubernetes keeps it that way.

What you'll learn

  • Clusters, nodes and pods
  • Deployments and ReplicaSets
  • Services
  • ConfigMaps and Secrets
  • kubectl

Kubernetes objects

  • Cluster
  • Node (machine)
  • Pod
  • Container
  • Deployment → manages Pods
  • Service → routes to Pods
  • Ingress → routes HTTP to Services

Key concepts

Pod
The smallest unit: one or more containers that run together.
Deployment
Keeps a desired number of pod replicas running and handles updates.
Service
A stable network address in front of changing pods.
Desired state
You declare what you want in YAML; Kubernetes makes it so.

Step by step

  1. 3.1

    Run a local cluster

    kind or minikube on your laptop.

  2. 3.2

    Deploy

    A Deployment with 2–3 replicas of your image.

  3. 3.3

    Expose

    A Service gives a stable address to the pods.

  4. 3.4

    Configure

    ConfigMaps for settings, Secrets for passwords.

Notes

  • Pods are temporary; never rely on a specific pod staying alive.

Tips & tricks

  • Practise on a local cluster (kind or minikube).

Interview questions

What happens when a pod crashes?

The Deployment's controller notices fewer replicas than desired and creates a new pod automatically; the Service keeps routing to healthy pods.

The quick way to study this

Deploy your app to a local cluster with a Deployment and a Service.

4

Docker & Kubernetes · Step 4 of 5 · 1 week

Production Kubernetes

Ingress, scaling and Helm.

Real clusters need ingress for traffic, resource limits, autoscaling and health probes. Managed services handle the control plane for you.

What you'll learn

  • Ingress and TLS
  • Resource requests and limits
  • Autoscaling
  • Helm charts
  • Managed Kubernetes (EKS, AKS, GKE)
  • Health probes

Traffic into a cluster

  1. User
  2. DNS
  3. Load balancer
  4. Ingress
  5. Service
  6. Pods

Key concepts

Readiness probe
Only send traffic when the app is ready.
Liveness probe
Restart the container if it's stuck.
HPA
Horizontal Pod Autoscaler: adds/removes pods based on load.
Helm
A package manager for Kubernetes apps (charts).

Step by step

  1. 4.1

    Ingress and TLS

    Route domains/paths to services with HTTPS.

  2. 4.2

    Requests and limits

    Set CPU/memory requests and limits for every container.

  3. 4.3

    Probes

    Readiness (ready for traffic?) and liveness (still alive?).

  4. 4.4

    Autoscaling

    HPA scales replicas on CPU or custom metrics.

Notes

  • Set resource requests; without them scheduling and scaling misbehave.

Tips & tricks

  • Use Helm to package and version deployments.

Interview questions

Readiness vs liveness probes?

Readiness decides whether a pod receives traffic; liveness decides whether it should be restarted. A slow-starting app should fail readiness, not liveness.

The quick way to study this

Add an ingress, autoscaling and probes to your local deployment.

5

Docker & Kubernetes · Step 5 of 5 · 4 days

CI/CD and GitOps

Automate builds and deployments.

Automate everything: build and scan images on every push, then deploy automatically. GitOps keeps the cluster in sync with what is in Git.

What you'll learn

  • Building images in CI
  • Image scanning
  • GitOpsটি টুল
  • Rolling and blue-green deployments
  • Rollbacks

CI/CD for containers

  1. Push code
  2. Test
  3. Build image
  4. Scan
  5. Push to registry
  6. Deploy (rolling)
  7. Monitor / rollback

Key concepts

Rolling update
Replace pods gradually so there's no downtime.
Canary
Send a small share of traffic to the new version first.
GitOps
Git is the source of truth what runs in the cluster.-এর জন্য

Step by step

  1. 5.1

    Build in CI

    Build, test and scan images on every push.

  2. 5.2

    Tag immutably

    Use the commit SHA as the image tag.

  3. 5.3

    Deploy safely

    Rolling updates by default; blue-green or canary for risky changes.

  4. 5.4

    GitOps

    A controller syncs the cluster with manifests in Git.

Notes

  • Tag images with the commit SHA, not just 'latest'.

Tips & tricks

  • Practise a rollback before you need one.

Interview questions

How do you roll back a bad deployment?

kubectl rollout undo deployment/app, or revert the Git commit in a GitOps setup. Immutable image tags make rollbacks reliable.

The quick way to study this

Set up a GitHub Actions pipeline that builds, scans and deploys your image.

এই পৃষ্ঠা শেয়ার করুন