Skip to content

Envoy Gateway Setup

Interactive Diagram

새 탭 ↗
ItemDetails
PurposeIntroduce Envoy Gateway in a Dev environment and validate Gateway API-based L7 routing with NodePort external exposure
Target EnvironmentAKS Dev cluster, namespace envoy-gateway
Key VersionsEnvoy Gateway v1.7.0, Envoy Proxy (distroless)
Related Repositoriescluster-init: control plane + Gateway CR, platform-gitops-deploy: per-app HTTPRoute

Previously, NGINX Ingress Controller was used for L7 routing based on Ingress resources. Envoy Gateway is an implementation of Kubernetes Gateway API (GatewayClass / Gateway / HTTPRoute), and this work is for coexistence and validation purposes.

  • Declare host/path routing using the Gateway API standard (HTTPRoute)
  • Deploy the data plane as a DaemonSet scheduled to specific nodes
  • Fix external entry points to NodePort (30080/30443) for easy LB/firewall integration
  • Apply IP whitelisting via SecurityPolicy
  • Detect client IP and control connections via ClientTrafficPolicy
IncludedExcluded
Install and configure in Dev envoy-gateway namespaceProduction rollout
GatewayClass + Gateway + EnvoyProxy + policiesBulk Ingress migration
HTTPRoute testing for target apps (nginx-proxy, pgadmin, rabbitmq)Full-service Gateway API migration
SecurityPolicy (IP whitelist)cert-manager integration, rate limiting

PlantUML Diagram

Envoy Gateway reference architecture: the controller watches the Kubernetes API and configures the Envoy proxy fleet and rate limit service over xDS, while client traffic flows through the Envoy service and proxies to backends Source: Envoy Gateway docs, Concepts, The Envoy Gateway Authors, Apache-2.0

RoleDescription
Control Planeenvoy-gateway Deployment, reads Gateway/HTTPRoute and delivers configuration to the data plane via xDS. Does not directly handle user traffic
Data PlaneEnvoy DaemonSet created per Gateway, receives requests on actual listeners and proxies to upstream
Client
→ (LB/VIP or Node IP)
→ NodePort 30080/30443
→ Service (80/443)
→ Pod targetPort (Envoy listen port, e.g., 10080)
→ HTTPRoute matching
→ Backend Service (e.g., nginx-proxy:8080)
CRDRole
GatewayClassLinks to controller, references EnvoyProxy via parametersRef
GatewayDefines listeners (HTTP 80, HTTPS 443 TLS Terminate)
EnvoyProxyInfrastructure spec: DaemonSet, Service (NodePort), images, etc.
ClientTrafficPolicyX-Forwarded-For, HTTP/1.0, bufferLimit
SecurityPolicyIP whitelist (CIDR-based)
HTTPRouteHost, rules, backendRefs (can be placed in app namespaces)

kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1
metadata:
name: platform-gateway-class
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller

Connecting an EnvoyProxy CR via parametersRef allows control over data plane settings such as DaemonSet/NodePort.

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: platform-gateway
spec:
gatewayClassName: platform-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: All
- name: https
protocol: HTTPS
port: 443
allowedRoutes:
namespaces:
from: All
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: platform-gateway-dummy-tls

Key Points:

  • allowedRoutes.namespaces.from: All: allows cross-namespace HTTPRoutes. Apps in other namespaces can reference this Gateway as parentRef
  • TLS: Using a self-signed dummy secret for the Dev environment. Replace with a real certificate for production
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: client-ip-detection
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: platform-gateway
clientIPDetection:
xForwardedFor:
numTrustedHops: 1
http1:
http10: {}
connection:
bufferLimit: "1024Mi"

The numTrustedHops setting is essential for detecting the actual client IP behind a load balancer.

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
name: ip-whitelist
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: platform-gateway
authorization:
defaultAction: Deny
rules:
- action: Allow
principal:
clientCIDRs:
- xxx.xxx.xxx.xxx/32
- xxx.xxx.xxx.yyy/32

IP-based access control can be declaratively applied at the Gateway level. This is more structured than the Ingress annotation approach.


kustomization.yaml
namespace: envoy-gateway
resources:
- ./namespaces.yaml
- ./dummy-tls-secret.yaml
- ./platform-gateway.yaml
helmGlobals:
chartHome: ../../../base/envoy-gateway/charts
helmCharts:
- name: gateway-helm-v1.7.0
version: v1.7.0
releaseName: envoy-gateway
namespace: envoy-gateway
valuesFile: values.yaml
includeCRDs: false

CRDs are managed separately (includeCRDs: false), to decouple CRD upgrades from controller upgrades.

ItemSetting
Imageenvoyproxy/gateway:v1.7.0
ResourcesCPU 100m / Memory 256Mi~1024Mi
Securitynon-root (UID 65532), seccompProfile RuntimeDefault
ServiceClusterIP (control plane), NodePort (data plane)
Replicas1 (Dev)
certgenTTL 30s, non-root