Konfidence is pre-release software. Concepts and APIs are unstable and subject to change.
Skip to content

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.

A client request enters the edge Gateway, whose per-stage HTTPRoute sets the x-konfidence-stage and x-konfidence-service headers, passes to the cluster-internal konfidence-router Gateway in the landscape namespace, whose Konfidence-managed stage HTTPRoute matches and removes both headers and forwards to the deployment result service of the active vector. The landscape namespace also holds the ReferenceGrant and the ActivationTaskRegistration you create.

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.

  1. Activation task registration per landscape: Create an ActivationTaskRegistration of type gateway-route.konfidence.cloud in each landscape namespace. Konfidence attaches routes only for registered landscapes.
  2. Inner Gateway per landscape: Create a Gateway named konfidence-router in each landscape namespace. Konfidence attaches its routes there.
  3. Cluster-internal inner Gateway: Make konfidence-router reachable only from inside the cluster. A client that reaches it directly can set x-konfidence-stage and x-konfidence-service itself and select any stage. GEP-5093 adds routability: Cluster to Gateway addresses for this. Use it if your implementation supports it. Otherwise, pin the service of konfidence-router to ClusterIP the way your implementation provides. Restrict traffic between the edge and the inner Gateways with NetworkPolicies as well.
  4. Stage and service headers at the edge: For each stage that you want to expose, set x-konfidence-stage to the stage name. Set x-konfidence-service to the deployment result name. Use set, not add, so that client-supplied values are overwritten. Then forward the request to konfidence-router.
  5. ReferenceGrant per landscape namespace: Your edge routes live in another namespace. Allow them to reference the konfidence-router service.

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:

yaml
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 EnvoyProxy resource pins konfidence-router to ClusterIP.
  • Set up Istio deploys one proxy per Gateway. Annotations on the Gateway pin konfidence-router to ClusterIP.
  • 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.

EU and German government funding logos

Funded by the European Union – NextGenerationEU.

The views and opinions expressed are solely those of the author(s) and do not necessarily reflect the views of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.