For Managed Omni Gateway deployed on Runtime Fabric on OpenShift, terminate external TLS at an OpenShift route and re-encrypt traffic to the gateway. This configuration uses two TLS connections:
-
The external client connects to the OpenShift route, which presents the cluster wildcard certificate.
-
The OpenShift route connects to Managed Omni Gateway, which presents its internal certificate. The route validates this certificate by using the destination CA certificate.
You must configure both of these resources together:
-
An HTTPRouteTemplate resource with reencrypt TLS termination, which configures the OpenShift route.
-
A PolicyBinding resource for the tls-inbound policy, which configures HTTPS on the APIs.
If you configure only the route template, the route can’t connect to the APIs over HTTPS. If you configure only the policy binding, external clients don’t connect to the gateway through the route with the cluster wildcard certificate.
Don’t create the OpenShift Route resource directly. Instead, create an HTTPRouteTemplate resource. The Runtime Fabric agent renders the template into the Route resource and keeps it reconciled.
Before You Begin
Before configuring inbound TLS for Managed Omni Gateway on Runtime Fabric, make sure that you have:
-
A Managed Omni Gateway deployed to Runtime Fabric. See Deploy a Managed Omni Gateway.
-
The cluster wildcard certificate and private key, in PEM format.
-
The CA certificate that signs the internal certificate of Managed Omni Gateway, in PEM format.
Create the Route Template
-
Create a YAML file with an HTTPRouteTemplate resource:
apiVersion: rtf.mulesoft.com/v1
kind: HTTPRouteTemplate
metadata:
name: omni-ingress-reencrypt
namespace: rtf
spec:
baseEndpoints:
- https://<public-hostname>/
resources: |
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ .ResourceName }}
namespace: {{ .Namespace }}
spec:
host: {{ .Host }}
path: {{ .Path }}
to:
kind: Service
name: {{ .Service.Name }}
tls:
termination: reencrypt
key: <cluster-wildcard-key-PEM>
certificate: <cluster-wildcard-cert-PEM>
caCertificate: <issuing-CA-chain-PEM>
destinationCACertificate: <omni-gateway-CA-PEM>
-
Apply the resource:
oc apply -f <file-name>.yaml
The reencrypt route connects to the gateway over HTTPS, so the APIs on Managed Omni Gateway must also serve HTTPS. To configure HTTPS on the APIs, bind the tls-inbound policy to them. You must apply this binding in addition to the HTTPRouteTemplate resource that you create in Create the Route Template.
-
Create a YAML file with a PolicyBinding resource.
To apply HTTPS to all APIs on the gateway, use a Selector target with no labels:
apiVersion: gateway.mulesoft.com/v1alpha1
kind: PolicyBinding
metadata:
name: tls-inbound-all-apis
namespace: <omni-gateway-namespace>
labels:
rtf.mulesoft.com/target-id: <omni-gateway-id>
spec:
targetRef:
kind: Selector
selector:
kind: ApiInstance
policyRef:
name: tls-inbound
config:
# TLS inbound parameters
Replace <omni-gateway-namespace> with the namespace of the Managed Omni Gateway and <omni-gateway-id> with the gateway ID from Runtime Manager.
-
Apply the resource:
oc apply -f <file-name>.yaml
Verify the Inbound TLS Configuration
After you apply both resources, run the following command from outside the cluster:
curl -v https://<public-hostname>
The TLS handshake completes and the response presents the cluster wildcard certificate, not the internal *.svc.cluster.local certificate of the gateway.
TLS Parameters
| Parameter |
Required or Optional |
Description |
|
|
|
|
|
Private key of the cluster wildcard certificate.
|
|
|
Cluster wildcard certificate that the route presents to external clients.
|
|
|
CA chain that issued the cluster wildcard certificate.
|
|
|
CA certificate that signs the internal certificate of Managed Omni Gateway. The route uses this CA to validate the gateway.
|