LAB07: Building Own Operator
LAB70 Building Own Operator (CRDs)
Below is a high-level architecture diagram
High-Level Architecture Diagram (Text + Visual Logic)
┌───────────────────────────────────────────┐
│ Your VPC / Network │
└───────────────────────────────────────────┘
│
▼
┌─────────────────────┐
│ HAProxy Server │
│ (External VM) │
│ /etc/haproxy/... │
└─────────────────────┘
▲
│ updates via Ansible
│
┌─────────────────────────────────┐
│ HAProxy Config Operator (Pod) │
│ - Watches Ingress objects │
│ - Extracts rules │
│ - Resolves NodePorts + NodeIPs │
│ - Renders HAProxy blocks │
│ - Calls ansible-playbook │
└─────────────────────────────────┘
│
│ watches
▼
┌─────────────────────────────────┐
│ Kubernetes API Server │
│----------------------------------│
│ • Ingress (w/ annotation) │
│ • Services (NodePort) │
│ • Endpoints │
│ • Nodes (InternalIP) │
└─────────────────────────────────┘
│
routes via │ NodePort
▼
┌──────────────────────────────────────────────────────────────────┐
│ Worker Nodes │
│──────────────────────────────────────────────────────────────────│
│ ┌────────────────────┐ ┌────────────────────┐ │
│ │ hello-app Pod │ │ nginx-demo Pod │ │
│ └────────────────────┘ └────────────────────┘ │
│ ^ ^ ^ ^ │
│ │ │ │ │ │
│ NodePort SVC │ NodePort SVC │ │
│ hello-app-svc│ nginx-demo-svc│ │
└──────────────────────────────────────────────────────────────────┘The Flow Explained (Short + Clear)
1. Developer creates an Ingress
2. Operator notices the annotated Ingress
3. Operator fetches service details
4. Operator generates HAProxy config
5. Operator pushes config using Ansible
6. External user request
Controller Implementation
Deployment Manifests
Test
Last updated