Oreon IT Helm charts / gateway-api-baseline

gateway-api-baseline Helm chart

Version 0.1.1 · app 0.1.0 · MIT · source · Artifact Hub

The shared-ingress setup we put on every cluster, as values: one Gateway API Gateway owned by the platform team, routes owned by application teams, and the glue that otherwise gets hand-written and forgotten.

The chart installs no controller. It works with any conformant implementation; we run it on GKE Gateway, Envoy Gateway, NGINX Gateway Fabric, Istio and Cilium.

Install

helm repo add oreonit https://oreondev.github.io/helm-charts
kubectl create namespace gateway-system
helm install gateway oreonit/gateway-api-baseline -n gateway-system -f gateway.yaml
kubectl label namespace web shared-gateway-access=true

gateway.yaml:

gatewayClassName: gke-l7-global-external-managed      # kubectl get gatewayclass
gateway:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod   # one cert per HTTPS listener
  addresses: [{type: NamedAddress, value: prod-gateway-ip}]
  listeners:
    https:
      hostnames:
        - "*.example.com"
        - example.com
      tls:
        certificateRefs: [{name: wildcard-example-com-tls}]

routes:
  - name: web
    namespace: web
    hostnames: [www.example.com]
    rules:
      - matches: [{path: {type: PathPrefix, value: /}}]
        backendRefs: [{name: web, port: 80}]
      - matches: [{path: {type: PathPrefix, value: /api}}]
        backendRefs:
          - {name: api, namespace: api, port: 8080, weight: 90}
          - {name: api-canary, namespace: api, port: 8080, weight: 10}
        timeouts: {request: 10s}
  - name: apex
    namespace: web
    hostnames: [example.com]
    rules:
      - filters:
          - type: RequestRedirect
            requestRedirect: {hostname: www.example.com, statusCode: 301}

That renders a Gateway with listeners http, https-wildcard-example-com and https-example-com, two HTTPRoutes in web attached to the listener that matches their hostnames, a ReferenceGrant in api allowing HTTPRoutes from web to reach api and api-canary, and the redirect route. See examples/multi-team.yaml for the full multi-namespace layout with the default backend and a BackendTLSPolicy.

Check the Gateway is programmed, then the routes are accepted:

kubectl -n gateway-system get gateway
kubectl get httproute -A -o custom-columns='NS:.metadata.namespace,NAME:.metadata.name,ACCEPTED:.status.parents[*].conditions[?(@.type=="Accepted")].status'

How routes find their listener

routeDefaults.sectionName: https (the default) means "the chart's HTTPS listener(s) that match this route's hostnames". With one wildcard-free https listener that is simply sectionName: https. With listeners.https.hostnames set, the chart compares each route hostname with each listener hostname (exact or wildcard, either side) and emits one parentRef per matching listener; a route whose hostnames match nothing fails the render with a message instead of silently never being programmed. Set sectionName: http, a literal listener name, or "" per route to attach elsewhere, or give the route raw parentRefs.

Values

Key Default Description
gatewayClassName "" (required) Class owned by your controller
apiVersions.* v1 / v1beta1 / v1 API versions for Gateway and routes, ReferenceGrant, BackendTLSPolicy
gateway.enabled true Create the Gateway; false to only create routes against an existing one named by gateway.name / gateway.namespace
gateway.name / gateway.namespace release / release ns Where the Gateway lives
gateway.annotations / labels {} e.g. cert-manager.io/cluster-issuer, networking.gke.io/certmap
gateway.infrastructure.{labels,annotations,parametersRef} {} Passed to the load balancer the controller creates
gateway.addresses [] Static addresses (NamedAddress on GKE, IPAddress elsewhere)
gateway.listeners.http.{enabled,port,hostname,redirectToHttps} on / 80 / any / on HTTP listener; with the redirect on, only the redirect route may attach to it
gateway.listeners.https.{enabled,port,hostnames} on / 443 / [] One listener for any hostname, or one per entry (string, or {hostname, certificateRefs})
gateway.listeners.https.tls.{mode,certificateRefs,options} Terminate / [] / {} Shared TLS config; cross-namespace Secret refs get a ReferenceGrant
gateway.listeners.extra [] Raw listeners (TLS passthrough, TCP, UDP)
gateway.allowedRoutes.{from,selector} Selector / shared-gateway-access: "true" Which namespaces may attach routes
gateway.extraSpec {} Merged into the Gateway spec
routeDefaults.{namespace,sectionName,timeouts,securityHeaders,labels,annotations} release ns / https / 30s / on Defaults every route inherits
securityHeaders HSTS, nosniff, DENY, strict-origin-when-cross-origin Headers set on responses
routes[] [] name, kind (HTTPRoute default, GRPCRoute), namespace, hostnames, rules, plus per-route overrides of the defaults and raw parentRefs
defaultBackend.{enabled,name,namespace,port} off Catch-all backend for unclaimed hostnames
referenceGrants.auto / extra true / [] Generated grants; raw extra grants
backendTLSPolicies[] [] service, sectionName, hostname, wellKnownCACertificates or caCertificateRefs

Notes

This is the ingress half of our Kubernetes production readiness checklist; namespace-baseline is the per-team half. If you would like the whole platform reviewed, see our production readiness audit or Kubernetes platform engineering services.

Licence

MIT. Maintained by Oreon IT.

Oreon IT

Maintained by Oreon IT

A London cloud, DevOps and SRE consultancy. If you want this chart rolled out and tuned for your platform, we can help.