gateway-api

by Das Meta

Helm chartv0.2.0App 1.16.0

A Helm chart for Kubernetes allowing to create Gateway API resources which is a standardized, next-generation(replaces k8s Ingress) specification for managing network traffic in Kubernetes clusters

About this chart

Gateway API

Helm chart to create Gateway API resources (standardized, next-generation replacement for Kubernetes Ingress) for managing network traffic in Kubernetes.

Supported versions

The chart renders the API versions below. It is tested against the Gateway API v1.6.x standard channel CRDs (v1.6.1) with Istio 1.30.x (1.30.3) as the Gateway implementation; other Gateway API implementations can use the non-Istio resources.

ResourceapiVersionValues key
Gatewaygateway.networking.k8s.io/v1gateways
HTTPRoutegateway.networking.k8s.io/v1httpRoutes
GRPCRoutegateway.networking.k8s.io/v1grpcRoutes
TCPRoutegateway.networking.k8s.io/v1tcpRoutes
TLSRoutegateway.networking.k8s.io/v1tlsRoutes
UDPRoutegateway.networking.k8s.io/v1udpRoutes
ListenerSetgateway.networking.k8s.io/v1listenerSets
BackendTLSPolicygateway.networking.k8s.io/v1backendTLSPolicies
ReferenceGrantgateway.networking.k8s.io/v1referenceGrants
AuthorizationPolicy, PeerAuthentication, RequestAuthenticationsecurity.istio.io/v1istio.authorizationPolicies, istio.peerAuthentications, istio.requestAuthentications
DestinationRule, ServiceEntry, Sidecar, VirtualService, Gateway, WorkloadEntry, WorkloadGroupnetworking.istio.io/v1istio.destinationRules, istio.serviceEntries, istio.sidecars, istio.virtualServices, istio.gateways, istio.workloadEntries, istio.workloadGroups
EnvoyFilternetworking.istio.io/v1alpha3istio.envoyFilters (plus generated ones, see below)
ProxyConfignetworking.istio.io/v1beta1istio.proxyConfigs
Telemetrytelemetry.istio.io/v1istio.telemetries
WasmPlugin, TrafficExtensionextensions.istio.io/v1alpha1istio.wasmPlugins, istio.trafficExtensions (TrafficExtension needs Istio 1.30+)

TCPRoute, TLSRoute, UDPRoute, ListenerSet and BackendTLSPolicy need the v1.6 standard channel CRDs (older releases ship them only in the experimental channel or at alpha versions). Their v1 rules have only name and backendRefs; matches on TCP/TLS/UDP rules are not rendered.

Install

helm repo add dasmeta https://dasmeta.github.io/helm
helm upgrade --install my-gateway dasmeta/gateway-api -f values.yaml

Public values and options: values.yaml. Example values: examples/gateway-api/. From repo root: helm template test charts/gateway-api -f examples/gateway-api/minimal.yaml.

You can either set gateways[].infrastructure.parametersRef to reference an existing ConfigMap, or set gateways[].infrastructure.parameters with the five keys (service, deployment, serviceAccount, horizontalPodAutoscaler, podDisruptionBudget). When parameters is set and non-empty, the chart creates a ConfigMap and sets parametersRef automatically; empty string values are omitted.

Key values

KeyDescriptionDefault / Example
enabledEnable chart (when used as subchart)false
gatewaysList of Gateway resources[]; see suboptions below
gateways[].gatewayClassNameGateway class for this Gatewayistio
gateways[].listenersListeners for this Gateway; hostname, port, protocol; name auto-generated (protocol-port-hostname, ≤63 chars)port 80, protocol HTTP
gateways[].listeners[].tlsFor HTTPS and TLS listeners. Absent → chart defaults to mode: Terminate and certificateRefs to Secret {gateway-name}-tls. tls: {} → explicit opt-out (no tls block in output; e.g. TLS handled in pod). Non-empty → rendered as-is. Secret must be provisioned by the caller (e.g. cert-manager or Terraform).optional
gateways[].infrastructureAnnotations, parametersRef (manual ConfigMap), or parameters (chart-generated ConfigMap)optional
gateways[].infrastructure.parametersInline config for service, deployment, serviceAccount, horizontalPodAutoscaler, podDisruptionBudget (object or string per key); chart creates a ConfigMap and sets parametersRef when non-empty; empty string omits keyoptional; when set, overrides parametersRef
defaultParentRefsDefault parentRefs for routes when not set per-route[]; kind=Gateway, group=gateway.networking.k8s.io
httpRoutesList of HTTPRoute resources[]; see suboptions below
httpRoutes[].name, nameSuffixRoute name and optional suffix for the resource namee.g. name: main, nameSuffix: -route
httpRoutes[].parentRefsGateway parent refs (name, sectionName, kind, group); optional if defaultParentRefs setname: main, sectionName: http
httpRoutes[].hostnamesHostnames this route matches. Supports templated expressions via Helm tpl.e.g. {{ .Values.global.environment }}.example.com
httpRoutes[].rulesRoute rules: matches (path, headers), backendRefs, filters (e.g. RequestRedirect), directResponsePathPrefix /, backendRefs to service
httpRoutes[].rules[].directResponse.statusDirect response status. 403 keeps AuthorizationPolicy flow; non-403 statuses are rendered via Istio EnvoyFilter403 or 200-599
httpRoutes[].rules[].directResponse.bodyOptional response body for non-403 direct responses"" (empty string)
httpRoutes[].rules[].backendRefsOne backendRef object or a list{ name: api, port: 8080 }
httpRoutes[].rules[].backendRefs[].externalBackend outside the cluster behind an ExternalName Service (the backendRef name/port). Renders an Istio ServiceEntry ext-<route> (ext-<route>-<backend> when a route has several), plus a TLS origination DestinationRule for protocol: HTTPS. Must be the only backendRef of its rule. Fields: host (external name, defaults to the first route hostname), endpoint (DNS target of the ServiceEntry, defaults to host), protocol (HTTP/HTTPS), rewriteHost (send host as the upstream Host header), create (also create the ExternalName Service; leave off for an existing one), exportTo (namespaces that see the ServiceEntry/DestinationRule, default the route's parent Gateway namespaces so other mesh workloads keep their own handling of that host and port). A backend used by several rules or routes is registered once; reusing it with other settings failsoptional
httpRoutes[].luaEnvoy Lua source (envoy_on_request/envoy_on_response) for logic an HTTPRoute can't express. Renders the EnvoyFilter <route>-lua that inserts the filter right before the router of the route's parent Gateways. It runs for every request on those Gateways, so the code must return right away for other hosts. Not rendered with tploptional
grpcRoutesList of GRPCRoute resourcesexample in values.yaml
tcpRoutesList of TCPRoute resourcesexample in values.yaml
tlsRoutesList of TLSRoute resourcesexample in values.yaml
udpRoutesList of UDPRoute resourcesexample in values.yaml
listenerSetsList of ListenerSet resources; the parent Gateway needs allowedListenersspec passed as-is
backendTLSPoliciesList of BackendTLSPolicy resources (TLS from the Gateway to backends)spec passed as-is
referenceGrantsList of ReferenceGrant resources (cross-namespace references)spec passed as-is
gateways[].allowedListenersWhich namespaces may attach ListenerSets (from: Same/All/Selector/None)optional
gateways[].tlsGateway level TLS: frontend client certificate validation, backend.clientCertificateRefoptional
httpRoutes[].rules[].name, timeoutsRule name and request/backendRequest timeoutsoptional
httpRoutes[].rules[].matches[].method, queryParamsMethod and query parameter matches (routing rules only; directResponse rules accept path matches only)optional
*Routes[].rules[].backendRefs[].group, kindNon-Service backends, e.g. kind: Hostname, group: networking.istio.iooptional
istioIstio-specific CRDs (when using Istio as Gateway implementation)see suboptions below
istio.defaultTargetRefsDefault targetRefs for AuthorizationPolicy[]
istio.gatewaysList of Istio Gateway resources (networking.istio.io; for VirtualService)selector, servers
istio.authorizationPoliciesList of AuthorizationPolicy (allow/deny by path, host, IP). rules supports templated expressions via Helm tpl.action DENY/ALLOW, rules
istio.peerAuthenticationsList of PeerAuthentication (mTLS)mode STRICT/PERMISSIVE
istio.virtualServicesList of VirtualService resourceshosts, http match/route
istio.sidecarsList of Sidecar resources[]
istio.envoyFiltersList of EnvoyFilter resources passed in full (targetRefs/workloadSelector, configPatches, priority); default namespace istio-system[]
istio.trafficExtensionsList of TrafficExtension resources (Lua or Wasm, Istio 1.30+); default namespace istio-system[]
istio.wasmPluginsList of WasmPlugin resources; default namespace istio-system[]
istio.proxyConfigsList of ProxyConfig resources[]

The passthrough lists (listenerSets, backendTLSPolicies, referenceGrants, istio.envoyFilters, istio.trafficExtensions, istio.wasmPlugins, istio.proxyConfigs) take name, namespace, labels, annotations and the resource's spec fields at the item's top level (or under spec).

Templating support notes

  • httpRoutes[].hostnames values are rendered with Helm tpl.
  • istio.authorizationPolicies[].rules values are rendered with Helm tpl.
  • Generated EnvoyFilter configPatches are rendered with Helm tpl, so templates that resolve through route hostnames and related values propagate correctly.
  • backendRefs[].external.host/endpoint are rendered with Helm tpl; httpRoutes[].lua is passed as-is.

Example with external backends and a Lua filter: examples/gateway-api/with-external-backend-and-lua.yaml.

Deploy gateway-api with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gateway-api on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgateway-api is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply