Kubernetes Ingress Controller with zero-downtime updates built on OpenResty
4.2K
Cloud-Native Kubernetes Ingress Controller built on OpenResty with Zero-Downtime Updates
WSLProxy Ingress Controller is a high-performance, production-ready Kubernetes Ingress Controller built on OpenResty (NGINX + Lua). It provides dynamic L7 load balancing with zero-restart backend updates, advanced routing capabilities, and comprehensive observability.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Kubernetes Cluster β
β β
β ββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β WSLProxy β β OpenResty Pods β β
β β Controller βββββββββΆβ (Dynamic Proxy) β β
β β (Go) β HTTP β β β
β ββββββββββββββββββββ API β βββββββββββββββββββββ β β
β β β β Lua Dynamic β β β
β β Watches β β Upstream Manager β β β
β βΌ β βββββββββββββββββββββ β β
β ββββββββββββββββββββ β βββββββββββββββββββββ β β
β β CRDs: β β β OpenResty/NGINX β β β
β β - WSLProxyBackendβ β β (High Perf Proxy) β β β
β β - WSLProxyRoute β β βββββββββββββββββββββ β β
β β - Ingress β βββββββββββββββββββββββββββ β
β ββββββββββββββββββββ β β
β β β β
β β βΌ β
β βΌ ββββββββββββββββ β
β ββββββββββββββββββββ β Backend β β
β β Services & β β Services β β
β β Endpoints β ββββββββββββββββ β
β ββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The WSLProxy Ingress Controller uses a two-component architecture that separates the control plane from the data plane:
bwalia/wslproxy-ingress-controllerRole: Kubernetes Control Plane (Brain)
This is a Go-based Kubernetes controller that:
When it runs: Continuously as a Kubernetes Deployment Handles: Configuration management and Kubernetes integration Does NOT handle: Actual HTTP traffic
bwalia/wslproxy-openresty-ingressRole: Data Plane (Traffic Handler)
This is an OpenResty (NGINX + Lua) proxy that:
When it runs: As a DaemonSet or Deployment with LoadBalancer/NodePort Service Handles: All production traffic Does NOT handle: Kubernetes API interaction
β Separation of Concerns
β Zero-Downtime Updates
β Production Best Practices
β Scalability
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Controller Pod (1-3 replicas) β
β Image: bwalia/wslproxy-ingress-controller:1.0.0 β
β Resources: ~200Mi memory, ~100m CPU β
β Role: Configuration Management β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTP API
β (config updates)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenResty Pods (N replicas) β
β Image: bwalia/wslproxy-openresty-ingress:1.0.0 β
β Resources: ~512Mi memory, ~500m CPU per replica β
β Role: Traffic Handling β
β Service: LoadBalancer (receives external traffic) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Image | Purpose | Contains | Typical Replicas |
|---|---|---|---|
bwalia/wslproxy-ingress-controller | Control Plane | Go binary, Kubernetes client libraries | 1-3 (HA) |
bwalia/wslproxy-openresty-ingress | Data Plane | OpenResty, Lua scripts, HTTP API | 2-10+ (traffic-based) |
Both images are required for a functioning ingress controller setup.
# Add Helm repository (once available)
helm repo add wslproxy https://charts.wslproxy.org
helm repo update
# Install the controller
helm install wslproxy-ingress wslproxy/wslproxy-ingress-controller \
--namespace wslproxy-system \
--create-namespace \
--set ingressClass.isDefaultClass=true
# Verify installation
kubectl -n wslproxy-system get pods
kubectl -n wslproxy-system get svc
apiVersion: wslproxy.io/v1alpha1
kind: WSLProxyBackend
metadata:
name: my-api-backend
spec:
upstreams:
- host: api-server-1.default.svc.cluster.local
port: 8080
weight: 2
- host: api-server-2.default.svc.cluster.local
port: 8080
weight: 1
loadBalancing: weighted-round-robin
healthCheck:
enabled: true
path: /health
interval: 5
apiVersion: wslproxy.io/v1alpha1
kind: WSLProxyRoute
metadata:
name: my-api-route
spec:
host: api.example.com
paths:
- path: /api/v1
pathType: Prefix
backend:
name: my-api-backend
tls:
secretName: api-tls-cert
minVersion: "1.2"
rateLimit:
requestsPerSecond: 100
burst: 20
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
annotations:
wslproxy.io/load-balancing: "weighted-round-robin"
wslproxy.io/rate-limit: "100"
spec:
ingressClassName: wslproxy
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: 80
tls:
- hosts:
- app.example.com
secretName: app-tls
controller:
replicas: 2
leaderElection:
enabled: true
metrics:
enabled: true
port: 8080
logging:
level: info
format: json
openresty:
replicas: 3
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
resources:
limits:
cpu: "2"
memory: 2Gi
sharedDicts:
upstreams: "10m"
upstream_health: "10m"
cache: "50m"
certManager:
enabled: true
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
apiVersion: wslproxy.io/v1alpha1
kind: WSLProxyRoute
metadata:
name: canary-route
spec:
host: api.example.com
paths:
- path: /api
backend:
name: stable-backend
trafficSplit:
primary:
backend:
name: stable-backend
weight: 90
canary:
backend:
name: canary-backend
weight: 10
apiVersion: wslproxy.io/v1alpha1
kind: WSLProxyRoute
metadata:
name: header-route
spec:
host: api.example.com
headers:
X-API-Version: "v2"
paths:
- path: /api
backend:
name: api-v2-backend
apiVersion: wslproxy.io/v1alpha1
kind: WSLProxyRoute
metadata:
name: cors-route
spec:
host: api.example.com
cors:
allowOrigins:
- "https://app.example.com"
allowMethods:
- GET
- POST
- PUT
allowHeaders:
- Content-Type
- Authorization
maxAge: 3600
The controller exposes Prometheus metrics on port 8080:
# Controller metrics
wslproxy_controller_reconcile_duration_seconds
wslproxy_controller_reconcile_total
wslproxy_controller_errors_total
# OpenResty metrics
wslproxy_upstream_health_status
wslproxy_upstream_requests_total
wslproxy_upstream_response_duration_seconds
wslproxy_backend_config_updates_total
observability:
prometheus:
enabled: true
serviceMonitor:
enabled: true
interval: 30s
WSLProxy Ingress Controller is compatible with standard Kubernetes Ingress resources. To migrate from nginx-ingress:
See MIGRATION.mdβ for detailed migration guide.
Benchmarks show WSLProxy can handle:
Contributions welcome! Please see CONTRIBUTING.mdβ for guidelines.
Apache License 2.0 - See LICENSEβ
Built with β€οΈ by the WSLProxy Team
Content type
Image
Digest
sha256:02846b14dβ¦
Size
11.8 MB
Last updated
19 days ago
docker pull bwalia/wslproxy-ingress-controller