Configuring a passthrough Ingress route for OpenShift
To create a route admission policy
A cluster administrator must create a route admission policy to permit the HAProxy to route network traffic to the NGINX Ingress Controller within the cluster.
Create a file named route-admission-patch.yml in the current working directory with the following content:
Add the wildcardPolicy and namespaceOwnership elements in the route-admission-patch.yml file and set their values as shown in the code block:#route-admission-patch.yml
spec:
routeAdmission:
wildcardPolicy: WildcardsAllowed
namespaceOwnership: InterNamespaceAllowedTo apply the route admission policy changes, run the following commands:
oc project openshift-ingress-operator
oc patch IngressController default --patch-file <path to route-admission-patch.yml> --type merge
To add a wildcard route to the Nginx Ingress namespace
Create a file named bmc-route.yml in the current working directory with the following content:
For HTTPS traffic, add the following values in the bmc-route.yml file:
#bmc-route.yml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: passthrough-bmc
spec:
host: wildcard.<Domain>
wildcardPolicy: Subdomain
port:
targetPort: 443
tls:
termination: passthrough
insecureEdgeTerminationPolicy: None
to:
kind: Service
name: ingress-nginx-controllerFor HTTP traffic, add the following values in bmc-route.yml file:
#bmc-route.yml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: passthrough-bmc
spec:
host: wildcard.<Domain>
wildcardPolicy: Subdomain
port:
targetPort: 80
tls:
termination: edge
insecureEdgeTerminationPolicy: Allow
to:
kind: Service
name: ingress-nginx-controllerWhere <Domain> is the domain of the load balancer.
For example, if your URL is *.<tenant_name>-<env>-<tenant_type>.acme.bmc.com, then you must set the host field as wildcard.<tenant_name>-<env>-<tenant_type>.acme.bmc.com, and any subdomain before it would be captured as the wildcard.
To apply the changes that you made in the bmc-route.yml file, run the following commands:
oc project ingress-nginx
oc create -f <path to bmc-route.yml>
To verify the route configuration
To display the manifest in a yaml format, run the following commands:
oc get routes -o yaml passthrough-bmc
The manifest is displayed in a yaml format. The contents of this yaml file will match with the contents of the bmc-route.yml file if you have configured the routes correctly.