About gateway injection
Gateway injection utilizes the same mechanism as sidecar injection to deploy the Envoy proxy into gateway pods. To deploy a gateway:
- Create a Kubernetes
Deploymentand a correspondingServicein a namespace visible to the Istio control plane. - Annotate and label the deployment so the Istio control plane injects an Envoy proxy configured as a gateway.
- Apply Istio's
GatewayandVirtualServiceresources to control ingress or egress traffic.
TOC
Linux Kernel Compatibility Notice
For nodes running Linux kernel versions earlier than 4.11 (e.g., CentOS 7), additional configuration is required prior to gateway installation.
Skip this section if your kernel version is 4.11 or later.
Istio Gateway
Prerequisites
- Install
jqlocally to process JSON in these steps.
Procedure
On some operating systems (e.g., CentOS 7) with older Linux kernels, gateways may not be able to listen on ports below 1024. It is recommended to configure your gateway to use ports above 1024 to avoid privilege requirements. If you must use privileged ports (below 1024), configure the gateway-injection-template.txt to either add the NET_BIND_SERVICE capability to the gateway's istio-proxy container or run the gateway as the root user by updating the container security context settings.
-
Create a YAML file named
gateway-injection-template.txtthat contains the default injection template for gateways.Click to expand
gateway-injection-template.txt- Remove
sysctlsbecausenet.ipv4.ip_unprivileged_port_startis not available on old Linux kernels.
- Remove
-
Patch the default
gatewayinjection template forIstioresource: -
Wait for the control plane to return the
Readystatus condition by running the following command:
Kubernetes Gateway API
Prerequisites
- Alauda Container Platform 4.2.0 or later, or upgrade Gateway API CRDs to the latest version.
Procedure
On some operating systems (e.g., CentOS 7) with older Linux kernels, gateways may not be able to listen on ports below 1024. It is recommended to configure your gateway to use ports above 1024 to avoid privilege requirements. If you must use privileged ports (below 1024), configure the gateway to either add the NET_BIND_SERVICE capability to the gateway's istio-proxy container or run the gateway as the root user by creating a ConfigMap with custom container security context settings.
-
Create a ConfigMap named
asm-kube-gateway-optionsin the same namespace where you plan to deploy your Gateway:- Remove
sysctlsbecausenet.ipv4.ip_unprivileged_port_startis not available on old Linux kernels.
- Remove
-
Reference the ConfigMap in your Gateway resource by adding the
infrastructure.parametersReffield:This configuration ensures that the gateway deployment uses the custom security context settings defined in the ConfigMap.