How-to guide / Package task guides
Install Envoy Gateway
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Install Envoy Gateway with three experimental Kix packages:
gateway-apiinstalls the Kubernetes Gateway API CRDs.envoy-gateway-controllerinstalls the Envoy Gateway controller, its CRDs, and aGatewayClass.envoy-gatewaycreates aGatewayfor application routes. Once running, the controller deploys Envoy proxy pods for eachGateway.
Check the
Envoy Gateway compatibility matrix
to confirm your cluster’s Kubernetes version is supported by the Envoy
Gateway release in envoy-gateway-controller.
Add the Gateway API CRDs
Section titled “Add the Gateway API CRDs”Add a gateway-api instance to your cluster definition:
23 instances.gateway-system.gateway-api.package = packages.experimental.gateway-api;This instance claims the gatewayApi role so the cluster installs only one
set of Gateway API CRDs. Every Gateway API controller in the cluster, such as
envoy-gateway-controller or traefik, shares them.
If your Kubernetes provider already installs compatible Gateway API CRDs, do
not add gateway-api. Instead, set
cluster.roles.gatewayApi.binding = "exclusive" and declare the CRDs with
kix.mkImport. In the import,
set roles = [ "gatewayApi" ], set out.version to the installed Gateway API
version, and add a crds entry for each kind your controller uses:
envoy-gateway-controllerrequires Gateway API 1.6 or later and theGatewayClass,Gateway,HTTPRoute, andReferenceGrantCRDs.traefikrequires Gateway API 1.6.1 or later and those four CRDs, plusGRPCRoute,TLSRoute, andBackendTLSPolicy.
Include readiness.condition on GatewayClass (type = "Accepted") and
Gateway (type = "Programmed"), both with status = "True", so kix deploy
waits until the controller accepts the class and programs the Gateway:
1cluster.roles.gatewayApi.binding = "exclusive";2instances.gateway-system.platform-gateway-api.package = kix.mkImport {3 roles = [ "gatewayApi" ];4 out.version = "1.6.1";5 crds = [6 {7 group = "gateway.networking.k8s.io";8 kind = "GatewayClass";9 plural = "gatewayclasses";10 version = "v1";11 crdScope = "Cluster";12 readiness.condition = { type = "Accepted"; status = "True"; };13 }14 {15 group = "gateway.networking.k8s.io";16 kind = "Gateway";17 plural = "gateways";18 version = "v1";19 readiness.condition = { type = "Programmed"; status = "True"; };20 }21 { group = "gateway.networking.k8s.io"; kind = "HTTPRoute"; plural = "httproutes"; version = "v1"; }22 { group = "gateway.networking.k8s.io"; kind = "ReferenceGrant"; plural = "referencegrants"; version = "v1"; }23 ];24};If the import is missing a required CRD, a readiness condition, or a supported
out.version, evaluation fails and names what to fix.
Add the controller
Section titled “Add the controller”Add an envoy-gateway-controller instance:
27 instances.gateway-system.envoy-gateway-controller.package =28 packages.experimental.envoy-gateway-controller;Kix allows one envoy-gateway-controller instance per cluster. It reconciles
Gateway resources across all namespaces.
Add a Gateway
Section titled “Add a Gateway”Add an envoy-gateway instance with the listeners your applications need. It
can share the controller’s namespace or use its own:
32 instances.gateway-system.gateway = {33 package = packages.experimental.envoy-gateway;34 config.listeners = [35 {36 name = "http";37 port = 80;38 protocol = "HTTP";39 allowedRoutes.namespaces.from = "All";40 }41 ];42 };Each envoy-gateway instance creates one Gateway and grants the controller
permission to deploy Envoy proxy pods and a Service in that namespace. A
cluster can run multiple Gateways (such as a public Gateway and a private one),
each in its own namespace. By default, envoy-gateway claims the gateway
alias that kix.expose routes applications through. To add more
envoy-gateway instances, set aliases = [ ]; on the extra instances so only
one keeps the default gateway alias, then set
deps.gateway = ref.<namespace>.<instance>; on each application that should
use another Gateway.
listeners takes Gateway API Listener fields with their upstream names
(name, port, protocol, hostname, tls, allowedRoutes); a
misspelt field fails evaluation. The example permits routes from every
namespace. Restrict allowedRoutes.namespaces if only selected
namespaces should attach routes. kix.expose reads these listeners to
pick each application’s URL scheme and port, and fails when no listener
accepts an application’s host and namespace. An HTTPS listener without
tls.certificateRefs is not rendered.
By default, the Envoy proxies get a LoadBalancer Service. On clusters
without a load balancer (cluster.roles.loadBalancer.binding = "absent",
which kix.flavors.kind sets), the package switches to a NodePort Service
so the Gateway can still become ready. Use config.proxySpec (an Envoy
Gateway EnvoyProxy spec) to customize this Gateway’s proxy Service,
replica count, or pod settings.
When networkPolicy.enable = true, the package allows incoming traffic to
the proxy pods on the listener ports, and kix.expose allows the proxy pods
to reach each backend Service they route to.
Deploy the Kix cluster:
❱ kix deploy how-to-platform-gateway During deploy, Kix installs the CRDs, runs a Job to generate TLS
certificates for control-plane traffic between the controller and proxies,
and starts the controller. kix deploy waits until the GatewayClass is
Accepted and the Gateway is Programmed.
Verify the installation
Section titled “Verify the installation”Check the GatewayClass and Gateway:
❱ kubectl get gatewayclass,gateway --all-namespaces
NAME CONTROLLER ACCEPTED AGE
gatewayclass.gateway.networking.k8s.io/envoy-gateway-controller gateway.envoyproxy.io/gatewayclass-controller True 24s
NAMESPACE NAME CLASS ADDRESS PROGRAMMED AGE
gateway-system gateway.gateway.networking.k8s.io/gateway envoy-gateway-controller 172.18.0.5 True 22s The GatewayClass should report Accepted, and the Gateway should report
Programmed. On kind, Envoy Gateway sets the Gateway’s address to a kind node
IP.
If either resource stays unready, inspect its conditions and the controller logs:
❱ kubectl describe gatewayclass envoy-gateway-controller❱ kubectl describe gateway gateway -n gateway-system❱ kubectl logs -n gateway-system deployment/envoy-gateway --since=10m Migrate from a Helm installation
Section titled “Migrate from a Helm installation”Earlier versions of envoy-gateway created the GatewayClass and Gateway
and expected you to install the controller with Envoy Gateway’s Helm chart. Because two controllers must not reconcile the same
GatewayClass, uninstall the Helm release before deploying the upgraded
package. The commands below assume the Helm release is named eg in the
envoy-gateway-system namespace, matching Envoy Gateway’s install guide.
Envoy Gateway’s Helm chart installs the experimental Gateway API CRDs, while
gateway-api installs the standard channel. Check your routes and Gateways
before upgrading:
- Applying the standard CRDs drops experimental-only fields from existing
routes and Gateways. Remove any experimental fields before you deploy
gateway-api. - The experimental-only CRDs (
xbackends,xbackendtrafficpolicies, andxmeshesingateway.networking.x-k8s.io) remain in the cluster. Delete them once nothing uses them.
Uninstall the Helm release:
❱ helm uninstall eg --namespace envoy-gateway-system Uninstalling the Helm release leaves the CRDs in place, and the existing
Envoy proxy pods continue serving traffic with their last configuration.
Helm does not delete hook resources on uninstall, so it also leaves behind the
eg-gateway-helm-certgen ServiceAccount, Role (which still grants write access
to Secrets), RoleBinding, ClusterRole, ClusterRoleBinding, and Job, along with
the topology injector webhook. Delete them:
❱ kubectl delete serviceaccount,role,rolebinding,job --namespace envoy-gateway-system --selector app.kubernetes.io/instance=eg❱ kubectl delete clusterrole,clusterrolebinding,mutatingwebhookconfiguration --selector app.kubernetes.io/instance=eg Next, update your cluster definition:
- Add the
gateway-apiinstance shown in Add the Gateway API CRDs. - Add the
envoy-gateway-controllerinstance shown in Add the controller. - Remove
controllerName,proxyNamespace,gatewayClassName, andgatewayNamefrom theenvoy-gatewayinstance. Setting any of them now fails evaluation. - If
config.proxySpeconly setsenvoyService.type = "NodePort"for kind, remove it. The package now setsNodePortautomatically when the cluster has no load balancer.
Because Helm still owns fields on the existing CRDs, the first deploy stops
with a server-side apply conflict. Run kix deploy once with
--force-conflicts to transfer field ownership to Kix:
❱ kix deploy <cluster> --force-conflicts Subsequent deploys do not need --force-conflicts.
Envoy Gateway now deploys each Gateway’s proxy pods in the envoy-gateway
instance’s namespace, using a Deployment and Service named after the
Gateway. Because the Helm-installed controller created them under generated
names in Helm’s namespace (such as envoy-gateway-system), the new controller
creates a new proxy Deployment and Service while the old ones keep running.
On a cloud load balancer, the new Service receives a new IP address:
- Use the new IP address: Point DNS at the new address, then delete the old proxy resources with the command below.
- Keep the old IP address with
config.addresses: Delete the old proxy resources before runningkix deploysokix deploycan wait for the Gateway to becomeProgrammedon that IP. Because the oldServiceholds the IP until you delete it, the Gateway serves no traffic between the deletion and the newServiceclaiming the address.
Delete the old proxy resources from Helm’s namespace:
❱ kubectl delete deployment,service,serviceaccount,configmap,hpa,pdb --namespace envoy-gateway-system --selector app.kubernetes.io/managed-by=envoy-gateway