Recreating AWS ALB + EKS architecture pattern on my own infrastructure

In the AWS environment:

  1. AWS Application Load Balancer (ALB) – public-facing component with a public IP
  2. EKS Worker Nodes – in private subnets, not directly accessible from internet
  3. Kubernetes Services – exposed as NodePorts or using AWS Load Balancer Controller
  4. VPC Networking – handles internal routing securely

Very simple AWS diagram

              PUBLIC INTERNET
                     │
                     ▼
          ┌───────────────────────┐
          │   HAProxy VPS         │
          │  (Public IP Address)  │
          └───────────┬───────────┘
                      │
                      │ VPN/Private Network
                      ▼
          ┌───────────────────────┐
          │   K8s Worker Nodes    │
          │    (Private IPs)      │
          └───────────┬───────────┘
                      │
                      ▼
          ┌───────────────────────┐
          │  K8s Services/Pods    │
          │    (Cluster IPs)      │
          └───────────────────────┘

This is exactly the architecture that cloud providers like AWS use for security and scalability reasons:

  1. Security: Only the load balancer (HAProxy in your case) needs a public IP and is internet-facing
  2. Scalability: Worker nodes can be added/removed without changing public endpoints
  3. Management: Simpler firewall rules and network policies
  4. Flexibility: Can route traffic to different backends based on rules

With this approach, I essentially building a “mini-AWS” with:

  • HAProxy = AWS ALB
  • Your VPN tunnel = AWS VPC private subnet routing
  • Your K8s NodePorts = AWS Target Groups

First version Kubernetes cluster with k0s and HAProxy

                           PUBLIC INTERNET
                                 │
                                 ▼
                   ┌───────────────────────────┐
                   │       HAProxy VPS         │
                   │       (1.1.1.1)           │
                   │ SNI-based TLS Passthrough │
                   └───────────┬───────────────┘
                               │
                               │ NodePort Traffic (30000,300001)
                               │
┌──────────────────────────────┼────────────────────────────────────────┐
│                              ▼                                        │
│  ┌───────────────────────────────────────────────────────────────┐    │
│  │                   k0s Worker Node (22.22.22.22)               │    │
│  │                                                               │    │
│  │   ┌───────────────────┐        ┌───────────────────┐          │    │
│  │   │ tttttttt-gateway  │        │ bbbbbb-gateway    │          │    │
│  │   │ NodePort: 30000   │        │                   │          │    │
│  │   └─────────┬─────────┘        │ NodePort: 30001   │          │    │
│  │             │                  └─────────┬─────────┘          │    │
│  │             │                            │                    │    │
│  │   ┌─────────▼─────────┐        ┌─────────▼─────────┐          │    │
│  │   │ Istio Ambient     │        │ Istio Ambient     │          │    │
│  │   │ Gateway for       │        │ Gateway for       │          │    │
│  │   │ xxxxxxxx.fyi      │        │ xxxxxxxxxxxx.fyi  │          │    │
│  │   └─────────┬─────────┘        └─────────┬─────────┘          │    │
│  │             │                            │                    │    │
│  │             │                            │                    │    │
│  │   ┌─────────▼─────────┐        ┌─────────▼─────────┐          │    │ 
│  │   │ Application Pod   │        │ Application Pod   │          │    │
│  │   │ (Go App)          │        │ (Node.js App)     │          │    │
│  │   └───────────────────┘        └───────────────────┘          │    │
│  │                                                               │    │
│  └───────────────────────────────────────────────────────────────┘    │
│                                                                       │
│  ┌───────────────────────────────────────────────────────────────┐    │
│  │                 k0s Controller Node (1.2.3.4)                 │    │
│  │                          *3                                   │    │
│  │   ┌───────────────────┐        ┌───────────────────┐          │    │
│  │   │ Kubernetes API    │        │ Istio Control     │          │    │
│  │   │ Server            │        │ Plane             │          │    │
│  │   └───────────────────┘        └───────────────────┘          │    │
│  │                                                               │    │
│  │   ┌───────────────────┐        ┌───────────────────┐          │    │
│  │   │ etcd              │        │ cert-manager      │          │    │
│  │   │                   │        │                   │          │    │
│  │   └───────────────────┘        └───────────────────┘          │    │
│  │                                                               │    │
│  └───────────────────────────────────────────────────────────────┘    │
│                                                                       │
└───────────────────────────────────────────────────────────────────────┘
                             k0s Cluster