- Deploying Envoy Gateway v1.7.0 from scratch via FluxCD GitOps
- Translating legacy NGINX annotations into native Gateway API routes and custom Envoy CRDs
- Unblocking deployment rollouts past strict Azure Policy / Gatekeeper admission controls
- Re-architecting CORS enforcement from backend services to the cluster edge
- Diagnosing complex post-migration bottlenecks across Azure Blob Storage, OpenSearch, and Schema Registry
The rollout was codified using FluxCD GitOps (Kustomization and HelmRelease) into the envoy-gateway-system namespace. The deployment established:
- A standardized GatewayClass managed by the Envoy Gateway control plane
- A shared ite-gateway resource configured with dual HTTP (port 80) and HTTPS (port 443) listeners
- A global HTTP-to-HTTPS redirect rule enforcing TLS encryption across all incoming traffic
During initial bootstrapping in the hardened cluster, zero pods reached the Running state in envoy-gateway-system. Flux reconciliation entered an infinite retry loop, and Helm threw:
Error: another operation (install/upgrade/rollback) is in progress
Inspecting the pre-install hook job using kubectl describe job envoy-gateway-gateway-helm-certgen revealed the blocker:
Azure Policy (validation.gatekeeper.sh) intercepted and rejected the hook container because it lacked explicit CPU and memory resource requests and limits. The job timed out after 5 minutes, leaving the Helm release permanently locked in pending-install.
Once the hook failed, the main deployment also encountered ReplicaFailure for the exact same compliance reason.
The v1.7.0 chart introduced a new schema hierarchy. Resource limits were injected for both the certgen hook job and the core envoyGateway deployment:
To recover from the locked state without tearing down the namespace:
- Deleted the stuck Helm secret: kubectl delete secret -n envoy-gateway-system -l owner=helm,status=pending-install
- Removed failed hook jobs: kubectl delete job envoy-gateway-gateway-helm-certgen -n envoy-gateway-system
- Triggered immediate Flux reconciliation:
Expected cgroup v1 files not accessible
By analyzing the node-level runtime security posture, I verified this warning was completely benign in hardened Azure Kubernetes nodes where host /sys/fs/ access is restricted.
Legacy ingress configurations embedded inside individual Helm charts (ite-bff, ite-context, grafana, schema-registry, etc.) were disabled. Each was translated into a declarative HTTPRoute manifest targeting ite-gateway. (For a companion conceptual walkthrough on weighted canary traffic splitting and dual-controller coexistence during this transition, read Kubernetes Ingress Migration: Moving to Envoy Gateway Without Dropping Requests):
The application handled large OAuth tokens and enterprise metadata headers, which had previously relied on NGINX buffer tuning:
- large-client-header-buffers: "4 512k"
- client-header-buffer-size: "512k"
- proxy-busy-buffers-size: "512k"
With traffic actively routed through Envoy Gateway:
- Ingress Audit: Executed a cluster-wide audit (kubectl get ingress -A) to verify no workloads depended on the legacy controller.
- Manifest Removal: Deleted deprecated NGINX ingress resources and chart values across all Git repositories.
- Controller Teardown: Decommissioned the ingress-nginx controller, its associated LoadBalancer service, and its validating admission webhook configurations, eliminating resource waste and admission latency.
Under the legacy setup, nginx.ingress.kubernetes.io/enable-cors: "false" was configured, effectively bypassing the proxy and delegating CORS preflight handling directly to the backend BFF.
With Envoy Gateway, we shifted CORS handling left to the edge using a SecurityPolicy CRD attached directly to the HTTPRoute:
Frontend developers running locally on http://localhost:5173 encountered preflight CORS blocks when issuing GraphQL requests against the development cluster (https://api.ite-dev.example.com/graphql).
The initial fix failed because the Kustomize patch attempted to modify only index /0 of allowOrigins. I resolved this by patching the entire array strictly inside the development overlay, keeping higher environments secure:
This guaranteed that localhost origins were strictly forbidden from ever leaking into QA, UAT, or Production manifests.
Developers reported that file uploads (FileUploadDialog.vue PUT requests) continued failing CORS preflight even after Envoy CORS policies were active.
By inspecting browser network traces, I isolated the issue:
- File uploads did not route through Envoy Gateway.
- Clients obtained a short-lived Shared Access Signature (SAS) token and uploaded files directly to cloud blob storage (https://<storage-account>.blob.core.regulated-cloud.internal).
- The storage account's Blob service had an exact-match protocol mismatch: it had been configured for https://localhost:5173 instead of http://localhost:5173.
- Observation: kubectl get envoypatchpolicy -A displayed Accepted: True, but Programmed: False with reason ResourceNotFound.
- Diagnosis: The http listener patch applied cleanly. The https-apex listener was reported as missing because the Dev environment did not yet have active TLS secrets or routes attached to that listener. Once routes were bound, status flipped to Programmed: True.
- Observation: Queries to OpenSearch returned 500 Internal Server Error.
- Diagnosis: Audited the Envoy data-plane JSON access logs:
- Observation: Requests to schema-registry.ite-dev.example.com threw:
503 Service Unavailable: upstream connect error or disconnect/reset before headers. delayed connect error: Connection refused
- Diagnosis: This signature indicates Envoy is healthy, but the backend pod is unreachable or crashing.
- Remediation: An engineer attempted kubectl rollout restart svc schema-registry, which failed because Services are networking abstractions without rollouts. I identified the backing workload controller in schema-registry-cluster and triggered a graceful rollout:
- Zero-Downtime Migration: Successfully transitioned all ingress traffic from NGINX to Envoy Gateway v1.7.0 with zero dropped packets.
- Enterprise Gatekeeper Compliance: Codified resource request and limit baselines satisfying strict Azure Policy requirements.
- Edge Security Shift-Left: Centralized CORS preflight handling at the ingress layer while strictly isolating developer localhost exceptions to non-production overlays.
- 512k Header Processing: Successfully preserved large authentication header support via declarative EnvoyPatchPolicy configurations.
