gateway-api-extensions

by emberstack

Helm chartv1.0.22App 1.0.0Verified publisher

A Helm chart for Gateway API extensions (Gateways, HTTPRoutes, ReferenceGrants)

About this chart

Gateway API Helm Extensions

This chart provides templates for Gateway API resources. It can be used as the base for dynamic resources.

Requirements: Gateway API CRDs installed in the cluster (e.g. via the upstream gateway-api manifests or your cloud provider).

Templates target the Gateway API standard channel, v1.6.1.

KindapiVersionValues keyMinimum Gateway API
GatewayClass (cluster-scoped)gateway.networking.k8s.io/v1gatewayClassesv1.0
Gatewaygateway.networking.k8s.io/v1gatewaysv1.0
ListenerSetgateway.networking.k8s.io/v1listenerSetsv1.5
HTTPRoutegateway.networking.k8s.io/v1httpRoutesv1.0
GRPCRoutegateway.networking.k8s.io/v1grpcRoutesv1.1
TLSRoutegateway.networking.k8s.io/v1tlsRoutesv1.5
TCPRoutegateway.networking.k8s.io/v1tcpRoutesv1.6
UDPRoutegateway.networking.k8s.io/v1udpRoutesv1.6
BackendTLSPolicygateway.networking.k8s.io/v1backendTLSPoliciesv1.4
ReferenceGrantgateway.networking.k8s.io/v1beta1referenceGrantsv1.0

Every entry is a map keyed by resource name and is opt-in via enabled: true.

Notes:

  • ReferenceGrant is emitted as v1beta1, which is still the storage version upstream in v1.6.1 and is served by every supported release. This keeps the chart compatible with older clusters; v1 is served but not yet the storage version.
  • TCPRoute and UDPRoute only graduated to the standard channel in Gateway API v1.6. On older clusters they exist only in the experimental channel, so these sections render resources your API server may not recognise.
  • Experimental gateway.networking.x-k8s.io resources (XBackend, XBackendTrafficPolicy, XMesh) are intentionally out of scope for this chart.

Installation

Using OCI registry (recommended)

helm install gateway-api-extensions oci://ghcr.io/emberstack/helm-charts/gateway-api-extensions

Using Helm repository

helm repo add emberstack https://emberstack.github.io/helm-charts
helm repo update
helm upgrade --install gateway-api-extensions emberstack/gateway-api-extensions

Parameters

ParameterDescriptionDefault
nameOverrideOverride chart name""
fullnameOverrideOverride fully qualified app name""
namespaceOverrideOverride namespace""
commonLabelsLabels added to all resources{}
commonAnnotationsAnnotations added to all resources{}
gatewayClassesMap of GatewayClasses{}
gatewaysMap of Gateways{}
listenerSetsMap of ListenerSets{}
httpRoutesMap of HTTPRoutes{}
grpcRoutesMap of GRPCRoutes{}
tlsRoutesMap of TLSRoutes{}
tcpRoutesMap of TCPRoutes{}
udpRoutesMap of UDPRoutes{}
backendTLSPoliciesMap of BackendTLSPolicies{}
referenceGrantsMap of ReferenceGrants{}

Per-item keys common to every kind: enabled, fullnameOverride, labels, annotations.

See values.yaml for the full annotated field reference.

Usage Examples

GatewayClass

gatewayClasses:
  nginx:
    enabled: true
    controllerName: gateway.nginx.org/nginx-gateway-controller
    description: NGINX Gateway Fabric

Gateway with HTTP and HTTPS listeners

gateways:
  main:
    enabled: true
    gatewayClassName: nginx
    listeners:
      - name: http
        port: 80
        protocol: HTTP
        hostname: "*.example.com"
        allowedRoutes:
          namespaces:
            from: All
      - name: https
        port: 443
        protocol: HTTPS
        hostname: "*.example.com"
        tls:
          mode: Terminate
          certificateRefs:
            - name: wildcard-tls
              namespace: cert-manager
        allowedRoutes:
          namespaces:
            from: All

Gateway accepting ListenerSets

gateways:
  main:
    enabled: true
    gatewayClassName: nginx
    listeners:
      - name: https
        port: 443
        protocol: HTTPS
    allowedListeners:
      namespaces:
        from: Same

ListenerSet attaching extra listeners

listenerSets:
  extra:
    enabled: true
    parentRef:
      name: main
    listeners:
      - name: extra-https
        port: 8443
        protocol: HTTPS
        tls:
          mode: Terminate
          certificateRefs:
            - name: extra-tls

HTTPRoute with path-based routing

httpRoutes:
  my-app:
    enabled: true
    parentRefs:
      - name: main
        sectionName: https
    hostnames:
      - app.example.com
    rules:
      - matches:
          - path:
              type: PathPrefix
              value: /api
        backendRefs:
          - name: api-service
            port: 8080
      - matches:
          - path:
              type: PathPrefix
              value: /
        backendRefs:
          - name: frontend-service
            port: 3000

HTTPRoute with HTTP-to-HTTPS redirect

httpRoutes:
  redirect-http:
    enabled: true
    parentRefs:
      - name: main
        sectionName: http
    hostnames:
      - app.example.com
    rules:
      - filters:
          - type: RequestRedirect
            requestRedirect:
              scheme: https
              statusCode: 301

GRPCRoute

grpcRoutes:
  my-grpc:
    enabled: true
    parentRefs:
      - name: main
        sectionName: https
    hostnames:
      - grpc.example.com
    rules:
      - matches:
          - method:
              service: my.package.Service
              method: MyMethod
        backendRefs:
          - name: grpc-service
            port: 9090

TLSRoute (passthrough)

tlsRoutes:
  passthrough:
    enabled: true
    parentRefs:
      - name: main
        sectionName: tls
    hostnames:
      - secure.example.com
    rules:
      - backendRefs:
          - name: tls-backend
            port: 8443

TCPRoute and UDPRoute

tcpRoutes:
  postgres:
    enabled: true
    parentRefs:
      - name: main
        sectionName: postgres
    rules:
      - backendRefs:
          - name: postgres
            port: 5432

udpRoutes:
  dns:
    enabled: true
    parentRefs:
      - name: main
        sectionName: dns
    rules:
      - backendRefs:
          - name: coredns
            port: 53

BackendTLSPolicy

backendTLSPolicies:
  my-backend:
    enabled: true
    targetRefs:
      - group: ""
        kind: Service
        name: my-service
    validation:
      hostname: backend.example.com
      caCertificateRefs:
        - name: ca-bundle
          kind: ConfigMap
          group: ""

ReferenceGrant for cross-namespace certificate

referenceGrants:
  allow-cert-ref:
    enabled: true
    from:
      - group: gateway.networking.k8s.io
        kind: Gateway
        namespace: default
    to:
      - group: ""
        kind: Secret
        name: wildcard-tls

Deploy gateway-api-extensions 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-extensions 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-extensions is pinned at v1.0.22 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