Connectivity Link operator

Install Red Hat Connectivity Link on OpenShift Service Mesh and attach TLS, authentication and rate limits to a Gateway API route.

Updated CompTech Team

Red Hat Connectivity Link is the control plane for the Kubernetes Gateway API on OpenShift. It is the supported build of the Kuadrant project. Platform teams get one place to attach DNS, TLS, authentication and rate limits to every gateway, including the same policy across more than one cluster. Application teams keep owning their HTTPRoute.

Connectivity Link does not replace the data plane. OpenShift Service Mesh 3 provides the Envoy gateways. cert-manager Operator for Red Hat OpenShift issues the certificates. Connectivity Link then installs three component operators into its own namespace: Authorino for authentication and authorization, the DNS operator for north-south records, and Limitador for rate limits.

Match versions to the support matrix before you install. Connectivity Link 1.1 expects Service Mesh 3.0 and cert-manager 1.15. Connectivity Link 1.2 expects Service Mesh 3.1 and cert-manager 1.17. Newer pairs are published in the same matrix. Install the line your mirror actually holds.

Prerequisites

  • Cluster-admin on OpenShift 4.16 or later. The operator list names the packages.
  • Service Mesh 3 installed, with the Gateway API CRDs enabled.
  • cert-manager Operator for Red Hat OpenShift installed.
  • On a sealed site, the rhcl-operator package and its related images mirrored, and installPlanApproval: Manual.

Install the operator

oc create namespace kuadrant-system
oc create namespace ingress-gateway
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: kuadrant
  namespace: kuadrant-system
spec:
  upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: rhcl-operator
  namespace: kuadrant-system
spec:
  channel: stable
  installPlanApproval: Manual
  name: rhcl-operator
  source: redhat-operators
  sourceNamespace: openshift-marketplace

Approve the install plan, then create the control plane:

apiVersion: kuadrant.io/v1beta1
kind: Kuadrant
metadata:
  name: kuadrant
  namespace: kuadrant-system
spec: {}
oc get kuadrant -n kuadrant-system
oc get pods -n kuadrant-system

Wait until the Kuadrant resource is ready and Authorino, Limitador and the DNS operator show in kuadrant-system. Enable kuadrant-console-plugin under Home, Overview, Dynamic Plugins, then reload the console. Add Redis only when two clusters must share one rate-limit counter. A single lab uses Limitador's own store.

A gateway and a route

The platform engineer owns the Gateway. The application owns the HTTPRoute.

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: external
  namespace: ingress-gateway
spec:
  gatewayClassName: istio
  listeners:
  - name: http
    port: 80
    protocol: HTTP
    allowedRoutes:
      namespaces:
        from: All
oc new-project books
oc new-app quay.io/vravula_redhat/node-api:test -n books
oc get svc -n books

An HTTPRoute named books in the books namespace sets parentRefs to external in ingress-gateway, matches PathPrefix /api, and sends traffic to the Service port you just printed (backendRefs, often node-api on port 8080). Apply it and continue.

oc get gateway -n ingress-gateway
oc get httproute -n books

The Gateway's address is the host you call. An OpenShift Route is not required for this listener when the mesh exposes the gateway Service. On bare metal, put that Service on a MetalLB address.

Attach a rate limit

Policies use targetRef. Attach them to a Gateway when they apply to everything behind it, or to one HTTPRoute when they apply to one API.

apiVersion: kuadrant.io/v1
kind: RateLimitPolicy
metadata:
  name: books-limit
  namespace: books
spec:
  targetRef:
    group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: books
  limits:
    global:
      rates:
      - limit: 5
        window: 10s
oc describe ratelimitpolicy books-limit -n books

Call the route more than five times in ten seconds. Excess calls return HTTP 429. If the CRD on your cluster nests limits under defaults, follow the schema printed by oc explain ratelimitpolicy.spec. The targetRef does not change.

Authentication

An AuthPolicy attaches with the same targetRef. Authorino checks the credential.

  • API key. A Secret labelled for Authorino, selected by the policy.
  • JWT. The issuer URL is the Identity Server. Clients send Authorization: Bearer.
  • Scope. Attach the policy to the Gateway when every route needs a token, or to one HTTPRoute when only one application does.

TLS is a TLSPolicy plus a cert-manager issuer. On a sealed network, create the gateway DNS record in the site DNS rather than with a DNSPolicy.

What's next

  1. API Manager: product APIs, subscriptions and a developer portal in front of services. Connectivity Link is the cluster ingress; API Manager is the API product layer.
  2. Identity Server: the issuer an AuthPolicy can trust.
  3. Operator list: where this operator sits in the reviewed set.