Kubernetes for Backend Developers: Pods, Deployments, Services & Ingress Explained
A practical developer-first guide to Kubernetes. Learn container orchestration, writing deployment manifests, configuring health probes, and managing environment secrets.

- 1.Demystifying Kubernetes for Software Engineers
- 2.1. The Four Core Kubernetes Objects
- 3.2. Writing a Production Deployment Manifest (`deployment.yaml`)
- 4.3. Exposing the Application with a Service (`service.yaml`)
- 5.4. ConfigMaps and Secrets
- 6.5. Essential Kubernetes CLI Commands (Cheat Sheet)
- 7.6. Frequently Asked Questions (FAQ)
- 8.7. Horizontal Pod Autoscaling (HPA)
Demystifying Kubernetes for Software Engineers#
When deploying applications with Docker, running docker run on a single virtual machine works for small prototypes. However, in production environments, you need automated container self-healing, rolling zero-downtime deployments, horizontal autoscaling, and traffic load balancing across multiple server nodes.
Kubernetes (K8s) is the open-source container orchestration platform that manages the lifecycle of containerized applications at scale.
This guide explains core Kubernetes concepts from a backend developer's perspective with real YAML manifests.
1. The Four Core Kubernetes Objects#
[ Ingress Controller ] ──► (Routes public internet traffic)
│
▼
[ Service ] ──► (Internal load balancer with stable IP)
│
▼
[ Deployment ] ──► (Manages replicas & rolling updates)
│
▼
[ Pods ] ──► (Containers running your Node.js/Go app)2. Writing a Production Deployment Manifest (`deployment.yaml`)#
A Deployment defines how many copies (replicas) of your container should run and how updates are rolled out:
apiVersion: apps/v1
kind: Deployment
metadata:
name: vyuhantrix-api
labels:
app: vyuhantrix-api
spec:
replicas: 3 # Run 3 identical container instances across nodes
selector:
matchLabels:
app: vyuhantrix-api
template:
metadata:
labels:
app: vyuhantrix-api
spec:
containers:
- name: api-container
image: vyuhantrix/api:v1.4.0
ports:
- containerPort: 3000
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
# Health Probes for automated self-healing
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 15
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 5
periodSeconds: 53. Exposing the Application with a Service (`service.yaml`)#
Pods in Kubernetes are ephemeral — their IP addresses change every time a container restarts. A Service provides a stable internal DNS name and load balances traffic across active pods:
apiVersion: v1
kind: Service
metadata:
name: vyuhantrix-api-service
spec:
type: ClusterIP # Internal cluster network routing
selector:
app: vyuhantrix-api
ports:
- protocol: TCP
port: 80
targetPort: 3000Now any other microservice inside the cluster can communicate with your API simply by making HTTP requests to http://vyuhantrix-api-service:80!
4. ConfigMaps and Secrets#
Never bake passwords or API keys into Docker images. Use Kubernetes ConfigMaps for environment variables and Secrets for sensitive credentials:
apiVersion: v1
kind: ConfigMap
metadata:
name: api-config
data:
NODE_ENV: "production"
PORT: "3000"
---
apiVersion: v1
kind: Secret
metadata:
name: api-secrets
type: Opaque
stringData:
DATABASE_URL: "postgresql://user:password@postgres-db:5432/prod"5. Essential Kubernetes CLI Commands (Cheat Sheet)#
| Command | Action |
|---|---|
kubectl apply -f deployment.yaml | Apply or update declarative configuration |
kubectl get pods | List all running pods and their restart status |
kubectl logs -f | Stream live console logs from a container |
kubectl rollout restart deployment/ | Trigger a graceful zero-downtime rolling restart |
kubectl exec -it | Open an interactive terminal shell inside a pod |
6. Frequently Asked Questions (FAQ)#
Q: What is the difference between a Liveness Probe and a Readiness Probe? A **Liveness Probe** checks if your container is still alive; if it fails (e.g. infinite loop / deadlocked thread), Kubernetes kills and restarts the container. A **Readiness Probe** checks if your container is ready to accept user traffic (e.g. database connection initialized); if it fails, Kubernetes temporarily stops sending HTTP requests to that pod until it recovers.
7. Horizontal Pod Autoscaling (HPA)#
In production, traffic fluctuates between peak daytime hours and overnight quiet periods. Kubernetes HorizontalPodAutoscaler (HPA) automatically scales the number of running pod replicas based on observed CPU and RAM utilization:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: vyuhantrix-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: vyuhantrix-api
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75When average CPU utilization across your pods exceeds 75%, Kubernetes automatically spins up new pod replicas across your worker nodes within 30 seconds!

Published by
Vyuhantrix Team
DevOps & Infrastructure · Vyuhantrix
Vyuhantrix is an open technology learning platform based in Ahmedabad, India, publishing step-by-step programming tutorials, system design breakdowns, and free developer tools.
Keep Learning
Recommended Guides
Cloud Infrastructure Demystified: AWS, Cloudflare, and Serverless Architecture
A clear breakdown of cloud service models (IaaS, PaaS, Serverless), edge deployments, storage buckets, container orchestrations, and DevOps best practices.
Microservices vs. Monolith: An Honest Architecture Decision Guide for 2026
A thorough analysis of when to choose microservices versus a monolithic architecture — covering organizational readiness, operational complexity, data consistency, service boundaries, and the strangler pattern for incremental migration.
AWS Lambda & Serverless Architecture: Complete Production Guide
A comprehensive guide to building production serverless applications with AWS Lambda — cold starts, memory optimization, event sources, VPC integration, layers, concurrency limits, monitoring with CloudWatch, and cost optimization strategies.