Kubernetes Features
KubernetesK8s FeaturesAuto-ScalingSelf-HealingDevOps Beginner 7 min read

Kubernetes Features

A comprehensive walkthrough of Kubernetes' core features — from self-healing and auto-scaling to rolling updates, service discovery, storage management, and security.

06 — Kubernetes Features

“Kubernetes does for your application what a seasoned operations team would do — but automatically, at scale, 24/7.”


📌 Table of Contents


Feature Overview

mindmap root((☸️ Kubernetes Features)) Compute Bin Packing Resource Limits QoS Classes Resilience Self-Healing Liveness Probes Readiness Probes Scaling HPA VPA Cluster Autoscaler Deployment Rolling Updates Canary Releases Blue-Green Deploys Rollbacks Networking Service Discovery Load Balancing Ingress DNS Storage PersistentVolumes StorageClasses Dynamic Provisioning Security RBAC Secrets NetworkPolicy Pod Security Extensibility CRDs Operators Admission Webhooks

1. Automatic Bin Packing

Kubernetes automatically places containers onto nodes based on resource requirements (CPU, memory) and constraints — maximising utilisation without sacrificing availability.

graph TD subgraph "3 Worker Nodes — Before Scheduling" N1["🖥️ Node 1\n4 CPU · 8 GB RAM\n── Available ──"] N2["🖥️ Node 2\n4 CPU · 8 GB RAM\n── Available ──"] N3["🖥️ Node 3\n4 CPU · 8 GB RAM\n── Available ──"] end subgraph "Pods to Schedule" P1["Pod A\n2 CPU · 4 GB"] P2["Pod B\n1 CPU · 2 GB"] P3["Pod C\n1 CPU · 2 GB"] P4["Pod D\n2 CPU · 3 GB"] end subgraph "After Kubernetes Scheduling ✅" N1A["🖥️ Node 1\nPod A (2C/4G) + Pod C (1C/2G)\n= 3 CPU · 6 GB used"] N2A["🖥️ Node 2\nPod B (1C/2G) + Pod D (2C/3G)\n= 3 CPU · 5 GB used"] N3A["🖥️ Node 3\n── Free for new pods ──"] end style N1A fill:#326ce5,color:#fff style N2A fill:#326ce5,color:#fff style N3A fill:#27ae60,color:#fff

💡 This is like a smart packing algorithm — fitting containers into nodes to minimise waste, similar to packing items into the fewest boxes possible.


2. Self-Healing

Kubernetes continuously monitors containers and nodes, automatically responding to failures.

flowchart TD subgraph "Self-Healing Mechanisms" LV["🔍 Liveness Probe\nIs the container alive?\nHTTP · TCP · Command"] RD["✅ Readiness Probe\nIs the container ready\nto receive traffic?"] SP["🚀 Startup Probe\nHas the app finished\nstarting up?"] end subgraph "Automatic Responses" LV -->|Fails| RESTART["♻️ Container Restart"] RD -->|Fails| REMOVE["🚫 Remove from\nLoad Balancer"] SP -->|Fails| WAIT["⏳ Wait for startup\nbefore other probes"] NODE_FAIL["🖥️ Node Fails"] --> RESCHEDULE["📍 Reschedule pods\non healthy nodes"] end style RESTART fill:#326ce5,color:#fff style REMOVE fill:#f39c12,color:#fff style RESCHEDULE fill:#326ce5,color:#fff

Self-Healing in Action

sequenceDiagram participant K as ☸️ Kubernetes Controller participant P1 as 📦 Pod 1 (Healthy) participant P2 as 📦 Pod 2 (Crashing) participant P3 as 📦 Pod 3 (New) K->>P1: Health check ✅ K->>P2: Health check ❌ K->>P2: Restart attempt 1 (CrashLoopBackOff) K->>P2: Restart attempt 2 K->>P2: Restart attempt 3 K->>P3: Spawn replacement pod P3-->>K: Running & healthy ✅ K->>P2: Terminate old pod

3. Horizontal Scaling

Kubernetes can scale the number of pod replicas up or down automatically based on CPU, memory, or custom metrics.

Horizontal Pod Autoscaler (HPA)

graph LR METRICS["📊 Metrics Server\nCPU · Memory · Custom"] METRICS --> HPA["⚖️ HPA Controller\nCheck every 15 seconds"] HPA -->|"CPU > 70%\nScale UP"| SCALEUP["📦📦📦📦📦\n5 Replicas"] HPA -->|"CPU < 30%\nScale DOWN"| SCALEDWN["📦\n1 Replica"] HPA -->|"CPU 50%\nNo change"| STABLE["📦📦📦\n3 Replicas (default)"] style HPA fill:#326ce5,color:#fff style SCALEUP fill:#e74c3c,color:#fff style SCALEDWN fill:#27ae60,color:#fff style STABLE fill:#f39c12,color:#fff

YAML Example

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: web-app-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: web-app
  minReplicas: 1      # Minimum pods (cost saving)
  maxReplicas: 20     # Maximum pods (cost cap)
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70   # Scale when CPU > 70%

4. Rolling Updates & Rollbacks

Kubernetes updates applications incrementally — replacing old pods with new ones in a controlled manner, ensuring zero downtime.

Rolling Update Strategy

sequenceDiagram participant K as ☸️ Kubernetes participant LB as ⚖️ Load Balancer participant OldPods as 📦 v1.0 Pods (×3) participant NewPods as 🆕 v2.0 Pods Note over OldPods: 3/3 pods running v1.0 K->>NewPods: Start 1 new v2.0 pod NewPods-->>K: Health check passes ✅ K->>LB: Add v2.0 pod to rotation K->>OldPods: Terminate 1 v1.0 pod Note over OldPods,NewPods: 2x v1.0 + 1x v2.0 running K->>NewPods: Start 2nd v2.0 pod NewPods-->>K: Health check passes ✅ K->>OldPods: Terminate 2nd v1.0 pod K->>NewPods: Start 3rd v2.0 pod NewPods-->>K: Health check passes ✅ K->>OldPods: Terminate last v1.0 pod Note over NewPods: 3/3 pods running v2.0 ✅ Note over K,NewPods: Zero downtime throughout!

Rollback — One Command

# Deploy a bad version
kubectl set image deployment/web-app web-app=myapp:v2.0-broken

# Detect problem — immediately rollback
kubectl rollout undo deployment/web-app

# Or rollback to a specific revision
kubectl rollout undo deployment/web-app --to-revision=3

# Check rollout history
kubectl rollout history deployment/web-app

5. Service Discovery & Load Balancing

Kubernetes provides built-in service discovery using DNS. Every Service gets a stable DNS name and IP, regardless of which pods are running underneath.

graph TD CLIENT["📱 Client Request\nhttp://product-service:8080"] DNS["🔍 CoreDNS\nResolves 'product-service'\n→ ClusterIP: 10.96.45.23"] LB_K8S["⚖️ kube-proxy\n(Round-Robin Load Balancer)"] P1["📦 Pod 1\n10.244.1.5:8080"] P2["📦 Pod 2\n10.244.2.8:8080"] P3["📦 Pod 3\n10.244.3.2:8080"] CLIENT --> DNS --> LB_K8S LB_K8S --> P1 & P2 & P3 style DNS fill:#8e44ad,color:#fff style LB_K8S fill:#326ce5,color:#fff

Types of Kubernetes Services

TypeUse CaseAccessible From
ClusterIPInternal communication between servicesInside cluster only
NodePortExpose app on a specific port of each nodeExternal (port 30000–32767)
LoadBalancerProvision cloud load balancerExternal internet
ExternalNameMap to an external DNS nameInside cluster

6. Storage Orchestration

Kubernetes can automatically mount and manage storage from various sources — local, NFS, cloud (AWS EBS, GCP PD, Azure Disk).

graph TD POD["📦 Pod\n(needs persistent storage)"] PVC["📋 PersistentVolumeClaim\n'I need 10 GB of SSD'"] SC["🏷️ StorageClass\n'fast-ssd' provisioner"] PV["💾 PersistentVolume\n10 GB EBS Volume\n(auto-provisioned)"] CLOUD["☁️ Cloud Storage\nAWS EBS · GCP PD · Azure Disk"] POD --> PVC --> SC --> PV --> CLOUD style POD fill:#326ce5,color:#fff style PV fill:#27ae60,color:#fff style CLOUD fill:#f39c12,color:#fff
# Developer just asks for storage
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: database-storage
spec:
  storageClassName: fast-ssd
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi   # I need 10 GB — K8s provisions it automatically

7. Secret & Configuration Management

Kubernetes separates application configuration from container images — making apps portable across environments without rebuilding.

graph LR subgraph "ConfigMap — Non-sensitive config" CM["📄 ConfigMap\n──────────────\nDB_HOST=postgres\nAPP_PORT=8080\nLOG_LEVEL=info"] end subgraph "Secret — Sensitive data" SEC["🔐 Secret\n──────────────\nDB_PASSWORD=****\nAPI_KEY=****\nTLS_CERT=****"] end CM --> POD["📦 Pod\n(injected as env vars\nor mounted as files)"] SEC --> POD style CM fill:#3498db,color:#fff style SEC fill:#e74c3c,color:#fff style POD fill:#326ce5,color:#fff

🔐 Secrets are stored base64-encoded in etcd and can be encrypted at rest. In production, integrate with HashiCorp Vault or cloud KMS for stronger security.


8. Batch Execution

Kubernetes supports Jobs (run-to-completion tasks) and CronJobs (scheduled tasks).

graph TD subgraph "Job — One-time task" J["📋 Job: Process\n10,000 invoice PDFs"] J --> W1["📦 Worker Pod 1\nProcessing 1–2,500"] J --> W2["📦 Worker Pod 2\nProcessing 2,501–5,000"] J --> W3["📦 Worker Pod 3\nProcessing 5,001–7,500"] J --> W4["📦 Worker Pod 4\nProcessing 7,501–10,000"] W1 & W2 & W3 & W4 --> DONE["✅ Job Complete"] end subgraph "CronJob — Scheduled task" CJ["⏰ CronJob\n'0 2 * * *'\nRuns every day at 2 AM"] CJ --> BACKUP["📦 Pod: Database\nBackup to S3"] end style DONE fill:#27ae60,color:#fff style CJ fill:#8e44ad,color:#fff

9. IPv4/IPv6 Dual Stack

Kubernetes supports running both IPv4 and IPv6 simultaneously, enabling:

  • Services accessible on both IPv4 and IPv6 addresses
  • Future-proofing for IPv6-only networks
  • Compatibility with existing IPv4 infrastructure

10. Extensibility

Kubernetes is extensible by design — you can add custom resources and controllers.

graph TD subgraph "Extending Kubernetes" CRD["📦 Custom Resource Definitions\n(CRDs)\nDefine your own K8s objects\ne.g. 'Database', 'Certificate'"] OP["🤖 Operators\nCustom controllers that manage\ncomplex stateful apps\ne.g. PostgreSQL Operator"] WH["🪝 Admission Webhooks\nValidate or mutate\nresources before they're stored"] API_EXT["🔌 API Aggregation\nExtend the K8s API\nwith your own endpoints"] end K8S["☸️ Kubernetes Core\nAPI"] --> CRD & OP & WH & API_EXT style K8S fill:#326ce5,color:#fff style OP fill:#27ae60,color:#fff
OperatorManages
cert-managerTLS certificates (Let’s Encrypt)
Prometheus OperatorMonitoring stack
PostgreSQL OperatorPostgreSQL clusters
Argo CDGitOps deployments
IstioService mesh

Feature Summary Table

#FeatureWhat it DoesKey Benefit
1Bin PackingOptimal container placement on nodesMaximise resource utilisation
2Self-HealingAuto-restart, replace, and rescheduleNo manual intervention
3Horizontal ScalingAdd/remove pod replicas automaticallyHandle any traffic level
4Rolling UpdatesUpdate with zero downtime + rollbackSafe, continuous delivery
5Service DiscoveryBuilt-in DNS + load balancingSimple microservice networking
6Storage OrchestrationAuto-provision & mount storagePersistent data for containers
7Config & SecretsSeparate config from codePortable across environments
8Batch JobsRun-to-completion & scheduled tasksBackground processing
9Dual StackIPv4 + IPv6 supportFuture-proof networking
10ExtensibilityCRDs, Operators, WebhooksAdapt K8s to any use case

🔗 Further Reading


← Previous: 05 - What is Container Orchestration? Next → 07 - Kubernetes Architecture Overview