Back to All Guides
Cloud & DevOps11 min readPublished: August 14, 2026Updated: August 15, 2026

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.

Vyuhantrix Team
Vyuhantrix Team
DevOps & Infrastructure · Vyuhantrix

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#

text
[ 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:

yaml
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: 5

3. 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:

yaml
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: 3000

Now 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:

yaml
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)#

CommandAction
kubectl apply -f deployment.yamlApply or update declarative configuration
kubectl get podsList 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 -- shOpen 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:

yaml
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: 75

When average CPU utilization across your pods exceeds 75%, Kubernetes automatically spins up new pod replicas across your worker nodes within 30 seconds!

Article Note & VerificationThis guide was written and reviewed by the Vyuhantrix Team for educational and practical accuracy. For framework-specific breaking changes, verify against the official documentation of the relevant project. Last updated: August 15, 2026. Disclaimer
Tags:#Kubernetes#Docker#DevOps#Cloud#Microservices#Containers
Vyuhantrix Team

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.