Gateway routing
Konfidence routes every request for a stage to the stage's active vector. This applies to stages that the Kubernetes deployer deploys.
As the cluster administrator, you provide the gateways that external requests enter through. Konfidence attaches its routes to those gateways, and you set up the rest.
How the two-gateway architecture works
For each stage with selected ingress ports, Konfidence keeps one HTTPRoute. On each activation, it updates that route to use the newly active vector's selected deployment result Services. Clients keep the same address while the vector behind it changes.
Konfidence attaches these routes to Gateways that you create. Whether a Gateway is reachable from outside or only inside the cluster depends on the Gateway API implementation. Konfidence leaves the Gateways to you so that it never exposes an internal Gateway by accident.
Konfidence creates and updates these routes only if the gateway-route.konfidence.cloud activation task has a registration in the landscape namespace. Without the registration, activations succeed but no route exists.
A request passes two Gateways. Your edge Gateway sets the stage and service headers. konfidence-router routes on them to the active vector.
The two headers select the target. x-konfidence-stage selects the stage, and x-konfidence-service selects the deployment result within it. You choose the external hostnames and paths in your edge routes. Konfidence matches only the two headers, so any hostname and path scheme works.
What your setup must provide
Konfidence works with any Gateway API implementation. Whichever you use, the five items below must be in place. The respective setup guide covers how to configure each one. For example, Set up Envoy Gateway walks through the steps to set up Envoy Gateway.
- Activation task registration per landscape: Create an
ActivationTaskRegistrationof typegateway-route.konfidence.cloudin each landscape namespace. Konfidence attaches routes only for registered landscapes. - Inner Gateway per landscape: Create a Gateway named
konfidence-routerin each landscape namespace. Konfidence attaches its routes there. - Cluster-internal inner Gateway: Make
konfidence-routerreachable only from inside the cluster. A client that reaches it directly can setx-konfidence-stageandx-konfidence-serviceitself and select any stage. GEP-5093 addsroutability: Clusterto Gateway addresses for this. Use it if your implementation supports it. Otherwise, pin the service ofkonfidence-routertoClusterIPthe way your implementation provides. Restrict traffic between the edge and the inner Gateways with NetworkPolicies as well. - Stage and service headers at the edge: For each stage that you want to expose, set
x-konfidence-stageto the stage name. Setx-konfidence-serviceto the deployment result name. Useset, notadd, so that client-supplied values are overwritten. Then forward the request tokonfidence-router. - ReferenceGrant per landscape namespace: Your edge routes live in another namespace. Allow them to reference the
konfidence-routerservice.
Konfidence creates one HTTPRoute per stage, named konfidence-stage-<stage>. It has one rule per deployment result of type http-k8s-service with an IngressExposedPortName. The application developer selects that port with the konfidence.cloud/exposed-port-name Service annotation. See Expose a Service through stage ingress.
A rule matches x-konfidence-stage: <stage> and x-konfidence-service: <deployment-result-name>. It removes both headers before it forwards the request.
If the active vector has no selected ports, the gateway-route activation succeeds and removes any existing stage HTTPRoute. It leaves Services, workloads, and your Gateways and edge routes unchanged.
To attach the routes to a different Gateway, set gatewayName and gatewayNamespace in the spec.spec of the registration. They default to konfidence-router and the landscape namespace.
Konfidence can provision konfidence-router for you
Instead of creating konfidence-router yourself, you can let Konfidence provision it. Set gatewayClassName in the spec.spec of the registration:
apiVersion: konfidence.cloud/v1alpha1
kind: ActivationTaskRegistration
metadata:
name: gateway-route
namespace: <LANDSCAPE_NAMESPACE>
spec:
type: gateway-route.konfidence.cloud
spec:
gatewayClassName: <GATEWAY_CLASS>Konfidence then creates a cluster-internal konfidence-router in the landscape namespace. You still provide the ReferenceGrant and the edge routes. Provisioning needs the Gateway API experimental-channel CRDs of v1.7.0 or later. Your Gateway API implementation must support GEP-5093.
ADR-0043 explains how Konfidence keeps the provisioned Gateway internal.
Three implementations have step-by-step guides
Each guide installs the same topology with one Gateway API implementation:
- Set up Envoy Gateway deploys one proxy per Gateway. An
EnvoyProxyresource pinskonfidence-routertoClusterIP. - Set up Istio deploys one proxy per Gateway. Annotations on the Gateway pin
konfidence-routertoClusterIP. - Set up Traefik needs one Helm release per Gateway. Each release manages exactly one Gateway.
None of the three supports GEP-5093 yet. Provisioning through gatewayClassName does not work with them.