Kubernetes Architecture — Internal Components & Secure Cloud Infrastructure
Rather than reading through dense abstract definitions, let's understand Kubernetes (K8s) through clear architectural diagrams:
- How the orchestrator works internally (anatomy of the Control Plane and Worker Node components).
- How to run a production Kubernetes cluster within a secure private cloud network, exposed safely to the web through WAF/DDoS filtering, and connected to an isolated, encrypted managed database.
⚙️ 1. Internal Anatomy: Kubernetes Components
A Kubernetes cluster is divided into two fundamental planes:
- Control Plane (Master): The central brain making decisions, scheduling workloads, and reconciling the desired state of the cluster.
- Worker Nodes: The compute machines executing containerized workloads (Pods).
📐 Component Flow Diagram
🛡️ 2. Secure Production Kubernetes Architecture in a Private Cloud VPC
In mission-critical enterprise environments, Worker Nodes must never have public IP addresses. They reside strictly inside private subnets within an isolated Virtual Private Cloud (VPC).
🔍 Core Security Principles:
- Perimeter Defense: Public requests hit a high-capacity WAF (Cloudflare or AWS WAF) for OWASP filtering and DDoS absorption before reaching an Application Load Balancer in the public subnet.
- Private Cluster Subnets: Worker Nodes operate on private IP CIDRs (
10.0.10.0/20). Outbound traffic to pull container registries or call external third-party payment APIs routes through a NAT Gateway with fixed egress IPs. - Restricted Control Plane: The Kubernetes API endpoint (
kube-apiserver) is private or IP-whitelisted, reachable only via VPN (WireGuard / Tailscale) or bastion jump hosts. - Database Governance (Managed DB):
- Never in an ephemeral container: We leverage a managed cloud engine (AWS RDS PostgreSQL) in Multi-AZ synchronous replication with automatic failover (<60s).
- Isolated Database Subnet: The DB sits in an air-gapped subnet with zero route to the internet gateway.
- Zero Hardcoded Credentials: Containers authenticate to the database via short-lived IAM credentials (AWS IRSA / Workload Identity) or automated Vault rotation, combined with KMS disk encryption and TLS 1.3 in transit.
- Workload Segregation (Orders & Catalog): Critical transactional writes (Orders) hit the Primary instance, while read-intensive catalog lookups target the Standby Read-Replica or local Redis caches.
- East-West Micro-segmentation (NetworkPolicies): Using eBPF-powered CNI (Cilium), default-deny ingress/egress rules ensure that even if a public web container is compromised, it cannot lateral move to the database or administrative namespaces.
🌐 End-to-End Infrastructure Architecture Diagram
🔐 3. The 5 Security Pillars
Strict 3-tier segregation: Public Subnet for Load Balancers, Private Subnet for Worker Nodes without public IPs, and an Isolated Subnet for the database without any internet route.
Cloud WAF stops SQL injections, XSS, and volumetric DDoS attacks. Sanitized traffic reaches the Application Load Balancer, which securely terminates TLS and hands off to the cluster Ingress Controller.
Managed Cloud PostgreSQL (RDS) with Multi-AZ synchronous replication. KMS at-rest disk encryption, TLS 1.3 in-transit, and credential-less authentication using ephemeral IAM tokens (IRSA).
Default-deny network policies enforced via eBPF (Cilium). Only whitelisted Pod labels can open port 5432 to the database. Even if a public container is breached, attackers cannot reach adjacent workloads or data stores.
Related reading:
- Infrastructure & Architecture Implementation — From Domain to Code for hexagonal design, ports and adapters.
- Detailed Application Design for tactical DDD and transaction management.