Coming soon Compute Forwards Learn more

Upgrade to provider v0.17 (Envoy Gateway)

Upgrade the provider to v0.17 and move tenant traffic from NGINX Gateway Fabric (NGF) to Envoy Gateway.

Envoy Gateway is the default gateway from provider v0.17. You install Envoy Gateway next to NGF, upgrade the provider and its operators, then upgrade the akash-gateway chart: that last upgrade migrates every tenant route to Envoy, switches the Gateway over and stops NGF, on its own. NGF and Envoy can’t run side by side, so NGF is removed at the end.

Time: About 30 minutes of preparation with no traffic impact. Tenant traffic and the provider ports are down for a few seconds during the akash-gateway upgrade.


Before you begin

  • The provider runs on Gateway API with NGF and the akash-gateway chart. If it still uses ingress-nginx, complete the Gateway API migration first: provider v0.17 has no ingress-nginx support, and its charts refuse to install in Ingress mode (gatewayApi.enabled: false).
  • kubectl and Helm 4 on the control plane node.
  • Your complete provider.yaml in /root/provider, as in Provider installation.
  • crictl on the nodes that serve tenant traffic (installed with Kubespray).

No firewall change: Envoy serves the same host ports as NGF (80, 443, 8443, 8444).

Order matters:

  1. Envoy Gateway is installed first: the akash-gateway chart creates Envoy resources, and the switch needs Envoy’s controller running.
  2. The provider and hostname operator are upgraded next: the migration needs the v0.17 hostname operator.
  3. akash-gateway is upgraded last, and that upgrade does the migration.

STEP 1: Install the Gateway API and Envoy Gateway CRDs

Install the Envoy Gateway CRDs and Gateway API v1.6.1 (experimental channel, which includes TCPRoute), the version Envoy Gateway v1.9.4 is built against. Apply them server-side: some CRDs are too large for client-side apply. --force-conflicts lets server-side apply take over the Gateway API CRDs that NGF installed.

Terminal window
helm template eg-crds oci://docker.io/envoyproxy/gateway-crds-helm --version v1.9.4 \
--set crds.gatewayAPI.enabled=true \
--set crds.gatewayAPI.channel=experimental \
--set crds.envoyGateway.enabled=true \
| kubectl apply --server-side --force-conflicts -f -

If NGF installed Gateway API v1.7.0, this replaces it with v1.6.1; NGF keeps working on v1.6.1. Check the version and that NGF still programs the Gateway:

Terminal window
kubectl get crd gateways.gateway.networking.k8s.io \
-o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/bundle-version}{"\n"}'
kubectl -n akash-gateway get gateway akash-gateway

Expected output: v1.6.1, and the Gateway with class nginx and PROGRAMMED True.


STEP 2: Install the Envoy Gateway controller

Install the controller in GatewayNamespace mode, so Envoy runs in the Gateway’s namespace (akash-gateway). Tenant network policies only allow traffic from that namespace.

Terminal window
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.9.4 \
-n envoy-gateway-system --create-namespace --skip-crds \
--set config.envoyGateway.provider.kubernetes.deploy.type=GatewayNamespace
Terminal window
kubectl -n envoy-gateway-system get pods

The envoy-gateway pod is Running. Nothing uses Envoy yet.


STEP 3: Prepare

Update Helm Repo

Terminal window
helm repo update akash
helm search repo akash | grep -E "provider|operator|akash-gateway"

Expected output:

akash/akash-gateway 1.3.0
akash/akash-hostname-operator 20.0.0 0.17.0
akash/akash-inventory-operator 20.0.0 0.17.0
akash/akash-ip-operator 20.0.0 0.17.0
akash/provider 20.0.0 0.17.0

Back Up

Terminal window
cd /root/provider
for i in $(helm list -n akash-services -q | grep -vw akash-node); do helm -n akash-services get values $i > ${i}.pre-v0.17.0.values; done
helm -n akash-gateway get values akash-gateway > akash-gateway.pre-v0.17.0.values
helm -n nginx-gateway get values ngf > ngf.pre-v0.17.0.values
kubectl get httproutes,snippetsfilters -A -l akash.network=true -o yaml > routes.pre-v0.17.0.yaml

Pre-Pull the Envoy Image

On every node that serves tenant traffic, to shorten the outage:

Terminal window
crictl pull docker.io/envoyproxy/envoy:distroless-v1.39.6

STEP 4: Upgrade the operators and the provider

Use --reset-then-reuse-values, not --reuse-values. --reuse-values also keeps the previous chart’s defaults, so gatewayApi.gatewayProvider would stay nginx instead of the new auto, and after the switch the hostname operator would keep writing NGF routes. The akash-gateway upgrade in STEP 5 checks this and stops if the operator is still set to nginx.

Terminal window
kubectl apply -f https://raw.githubusercontent.com/akash-network/provider/v0.17.0/pkg/apis/akash.network/crd.yaml
helm -n akash-services upgrade akash-hostname-operator akash/akash-hostname-operator \
--version 20.0.0 --reset-then-reuse-values
helm -n akash-services upgrade inventory-operator akash/akash-inventory-operator \
--version 20.0.0 --reset-then-reuse-values

With IP leasing (MetalLB):

Terminal window
helm -n akash-services upgrade akash-ip-operator akash/akash-ip-operator \
--version 20.0.0 --reset-then-reuse-values
Terminal window
helm -n akash-services upgrade akash-provider akash/provider \
--version 20.0.0 --reset-then-reuse-values

Check the images and the detected gateway:

Terminal window
kubectl -n akash-services get pods -o custom-columns='NAME:.metadata.name,IMAGE:.spec.containers[*].image'
kubectl -n akash-services get configmap operator-hostname -o jsonpath='{.data.gateway-provider}{"\n"}'
kubectl -n akash-services logs deploy/operator-hostname | grep gateway_implementation

The images reference 0.17.0, the operator’s gateway provider is auto, and its log shows "gateway_implementation":"nginx": everything still runs on NGF.

Optionally, review the route changes the migration will make. This writes nothing:

Terminal window
kubectl -n akash-services exec akash-provider-0 -c provider -- \
provider-services migrate gateway --to envoy --dry-run

STEP 5: Upgrade akash-gateway (migrates to Envoy)

This upgrade moves the Gateway to Envoy. It runs two short jobs around the switch:

  1. Before the switch (akash-gateway-gateway-migration-routes): checks that Envoy Gateway is installed and that the hostname operator is v0.17 with gateway provider auto, stops the hostname operator, and migrates every tenant route to Envoy (provider-services migrate gateway --to envoy). NGF keeps serving. If anything fails, the operator is started again and the upgrade stops before the Gateway changes.
  2. The switch: the Gateway’s class becomes envoy.
  3. After the switch (akash-gateway-gateway-migration-switch): waits until Envoy has created its proxies, stops the NGF controller and removes NGF’s proxies, which frees the host ports, waits until Envoy serves the Gateway, then starts the hostname operator, which detects Envoy. Tenant traffic is down from the moment NGF’s proxies are removed until Envoy’s start, a few seconds.
Terminal window
cd /root/provider
helm upgrade akash-gateway akash/akash-gateway \
-n akash-gateway \
--version 1.3.0 \
-f provider.yaml \
--timeout 15m

To follow the jobs from a second terminal:

Terminal window
kubectl -n akash-gateway logs -f job/akash-gateway-gateway-migration-routes
kubectl -n akash-gateway logs -f job/akash-gateway-gateway-migration-switch

Expected output of the second job:

waiting for Envoy to create its proxies
stopped NGINX Gateway Fabric controller nginx-gateway/ngf-nginx-gateway-fabric
deleted NGINX Gateway Fabric proxies daemonsets/akash-gateway-nginx
waiting for Envoy to program the Gateway
Gateway programmed by Envoy
hostname operator scaled to 1

STEP 6: Verify

Gateway and operator:

Terminal window
kubectl -n akash-gateway get gateway akash-gateway
kubectl -n akash-gateway get daemonset,pods -o wide
kubectl -n akash-services logs deploy/operator-hostname | grep gateway_implementation

The Gateway uses class envoy with PROGRAMMED True, the akash-gateway DaemonSet has a Ready pod on every node, and the operator log shows "gateway_implementation":"envoy".

Routes: every tenant route is accepted by Envoy Gateway.

Terminal window
kubectl get httproutes -A -l akash.network=true \
-o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{range .status.parents[?(@.controllerName=="gateway.envoyproxy.io/gatewayclass-controller")].conditions[?(@.type=="Accepted")]}{.status}{end}{"\n"}{end}'

Every line ends in True.

Policies: deployments’ http_options become BackendTrafficPolicies, which must be accepted.

Terminal window
kubectl get backendtrafficpolicies -A \
-o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{.status.ancestors[0].conditions[?(@.type=="Accepted")].status}{"\n"}{end}'

Traffic: a few deployment hostnames answer on 80 and 443, including one custom domain. The provider answers on 8443:

Terminal window
curl -sk https://provider.<your-domain>:8443/status | jq .

Watch for deployment errors for an hour after the upgrade.


STEP 7: Remove NGF

NGF and Envoy can’t run side by side: while NGF’s controller runs, it recreates its proxies, which take the host ports back. The upgrade stopped it; once the provider has run cleanly on Envoy (and you no longer need to roll back), uninstall it:

Terminal window
helm uninstall ngf -n nginx-gateway
kubectl get crd -o name | grep gateway.nginx.org | xargs kubectl delete
kubectl delete namespace nginx-gateway

The akash-gateway chart only creates its NGF settings while the Gateway is on NGF, so nothing else refers to NGF. Later akash-gateway upgrades need no extra flags.


Rolling back to NGF

Possible until NGF is uninstalled in STEP 7. The tenant routes are migrated after the switch, and NGF’s controller has to run again while Envoy’s stops:

Terminal window
cd /root/provider
kubectl -n akash-services scale deployment operator-hostname --replicas=0
kubectl -n nginx-gateway scale deployment ngf-nginx-gateway-fabric --replicas=1
kubectl -n nginx-gateway rollout status deployment ngf-nginx-gateway-fabric
helm upgrade akash-gateway akash/akash-gateway \
-n akash-gateway \
--version 1.3.0 \
-f provider.yaml \
--set gateway.gatewayClassName=nginx \
--set gateway.confirmClassChange=true
# once NGF has created its proxies (akash-gateway-nginx), free the ports for them
kubectl -n akash-gateway get daemonset akash-gateway-nginx
kubectl -n envoy-gateway-system scale deployment envoy-gateway --replicas=0
kubectl -n akash-gateway delete daemonset akash-gateway
kubectl -n akash-gateway rollout status daemonset akash-gateway-nginx
kubectl -n akash-services exec akash-provider-0 -c provider -- \
provider-services migrate gateway --to nginx
kubectl -n akash-services scale deployment operator-hostname --replicas=1

The hostname operator log then shows "gateway_implementation":"nginx". Keep --set gateway.gatewayClassName=nginx on later akash-gateway upgrades until you move to Envoy again; that upgrade (STEP 5 without the flag) starts Envoy’s controller again on its own.


What changes for deployments

Requests reach deployments as they did through NGF:

  • X-Real-IP, X-Forwarded-Host and X-Forwarded-Port are set by the gateway; values a client sends are replaced.
  • The client’s address is appended to X-Forwarded-For.
  • Header names with underscores are dropped.
  • Encoded slashes (%2F) and repeated slashes are passed through unchanged.

Differences:

  • Envoy resolves dot segments: /a/../b reaches the deployment as /b.
  • SDL http_options are applied as Envoy settings:
    • read_timeout and send_timeout share one idle timeout per request, set to the larger of the two.
    • next_timeout is not applied.
    • Retries apply to idempotent requests only (for example GET, HEAD, PUT, DELETE); a POST is not retried.
    • next_tries is capped at 10.
    • The timeout and invalid_header retry cases are ignored.
    • max_body_size and the proxy buffer options are not applied.

Troubleshooting

The akash-gateway upgrade fails with pre-upgrade hooks failed

The first job found a problem before changing anything. NGF still serves the Gateway and the hostname operator was started again. Read the reason:

Terminal window
kubectl -n akash-gateway logs job/akash-gateway-gateway-migration-routes
  • no Envoy Gateway controller found: do STEP 2.
  • hostname operator ... runs ...0.16... or gateway provider is "nginx": redo STEP 4 with --reset-then-reuse-values.
  • route migration failed: the job lists the routes that failed or that Envoy can’t serve. Fix them (or close the leases) and run the upgrade again.

The akash-gateway upgrade fails with post-upgrade hooks failed

The Gateway is already on Envoy, but Envoy didn’t serve it in time. The hostname operator was started again.

Terminal window
kubectl -n akash-gateway logs job/akash-gateway-gateway-migration-switch
kubectl -n akash-gateway get daemonset,pods -o wide
kubectl -n akash-gateway describe pod -l gateway.envoyproxy.io/owning-gateway-name=akash-gateway | grep -A5 Events

Envoy pods Pending with didn't have free ports mean something else still holds the host ports, usually NGF’s proxies: check that ngf-nginx-gateway-fabric is scaled to 0 and delete the akash-gateway-nginx DaemonSet. Once Envoy’s pods are Ready, the Gateway reports PROGRAMMED True.

The akash-gateway upgrade fails with no matches for kind "EnvoyProxy"

The Envoy Gateway CRDs are missing: run STEP 1. Nothing was changed.

The akash-gateway upgrade fails with “would switch it to … and move all tenant traffic at once”

The chart switches the Gateway on its own only from NGF to Envoy. Any other change of class, such as a rollback, needs --set gateway.confirmClassChange=true and the manual steps in Rolling back to NGF.

The hostname operator restarts with failed to resolve gateway provider

The operator reads the Gateway at startup and stops if the Gateway doesn’t exist or its class is neither Envoy Gateway nor NGF.

Terminal window
kubectl -n akash-gateway get gateway akash-gateway
kubectl get gatewayclass