Use Gateway API

Attach OpenBao to a compatible Gateway with TLS passthrough or verified backend TLS.

Updated 9 August 2026 · 3 min read

On this page

Use this page after choosing Gateway API as the external entry path. The cluster must serve Gateway API v1 resources used by the operator. OpenBao Operator 0.4.2 is built against Gateway API v1.6.0.

Choose the route mode

ModeOperator createsGateway listenerUse it when
TLS passthroughTLSRouteprotocol: TLS, tls.mode: PassthroughOpenBao should remain the TLS endpoint; required for ACME
Gateway terminationHTTPRoute and, by default, BackendTLSPolicyHTTP or HTTPSThe Gateway must apply HTTP-aware policy or present the client certificate

Passthrough is the smaller trust model because the Gateway never holds or uses the OpenBao server private key.

Configure passthrough

Create the Gateway and listener first:

apply

Create a TLS passthrough listener

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: main-gateway
  namespace: gateway-system
spec:
  gatewayClassName: traefik
  listeners:
    - name: openbao
      port: 443
      protocol: TLS
      tls:
        mode: Passthrough
      allowedRoutes:
        namespaces:
          from: Selector
          selector:
            matchLabels:
              openbao.org/gateway-access: "true"

Label each OpenBaoCluster namespace admitted by this shared listener with openbao.org/gateway-access=true. Gateway API defaults allowedRoutes.namespaces.from to Same, so a Route in another namespace will not attach unless the listener says otherwise.

Attach the cluster to that exact listener:

configure

Create the OpenBao TLSRoute

spec:
  gateway:
    enabled: true
    listenerName: openbao
    tlsPassthrough: true
    hostname: bao.example.com
    gatewayRef:
      name: main-gateway
      namespace: gateway-system

The operator routes ordinary TLS traffic to <cluster>-public on port 8200. In ACME mode it routes to the dedicated ACME Service on port 443. Add bao.example.com to spec.tls.acme.domains; Gateway hostnames are not copied into the ACME domain list. The selected GatewayClass must advertise TLSRoute support.

Configure termination and backend trust

When tlsPassthrough is false or omitted, the operator creates an HTTPRoute. Backend TLS is enabled by default when cluster TLS is enabled.

configure

Create an HTTPRoute with verified backend TLS

spec:
  gateway:
    enabled: true
    listenerName: openbao-https
    hostname: bao.example.com
    gatewayRef:
      name: main-gateway
      namespace: gateway-system
    backendTLS:
      enabled: true
      hostname: openbao-cluster-prod-cluster.local

The Gateway listener certificate is configured on the Gateway, not on the OpenBaoCluster. For the backend hop, the operator creates a BackendTLSPolicy and a <cluster>-tls-ca ConfigMap containing ca.crt. Its default verification name is <cluster>-public.<namespace>.svc, but External TLS validation does not require that SAN. Set backendTLS.hostname to the required internal name as shown, or issue the certificate with the public Service DNS SAN.

Hardened clusters reject backendTLS.enabled: false. The GatewayClass must advertise HTTPRoute and BackendTLSPolicy support for the default terminated path.

Allow the data plane to reach OpenBao

Route attachment and pod reachability are separate controls. Add the actual Gateway data-plane pods to spec.network.trustedIngressPeers; referencing a Gateway does not allow its entire namespace through NetworkPolicy.

configure

Allow the Gateway data plane

spec:
  network:
    trustedIngressPeers:
      - namespaceSelector:
          matchLabels:
            kubernetes.io/metadata.name: gateway-system
        podSelector:
          matchLabels:
            app.kubernetes.io/name: traefik

Use selectors that match the data-plane pods, which might not be the same pods as the Gateway controller.

Check compatibility and readiness

The operator validates the referenced Gateway, listener compatibility, GatewayClass acceptance, advertised features, installed API version, and the Gateway Programmed condition. For a Gateway in another namespace, its listener must also allow Routes from the OpenBaoCluster namespace.

ConditionMeaning
GatewayIntegrationReady=TrueThe operator verified the known Gateway contract for the selected mode
GatewayIntegrationReady=UnknownThe GatewayClass does not publish enough capability information, or the operator cannot read it
GatewayIntegrationReady=FalseA reference, listener, API version, feature, acceptance, or programmed-state check failed

Read the condition reason before changing the manifest. A missing status.supportedFeatures is reported as Unknown, not assumed compatible. GatewayIntegrationReady does not read the generated Route status, so separately require its Accepted and ResolvedRefs conditions and test the public hostname from outside the cluster.

Search the handbook

Try “install”, “threat model”, or “compatibility”.