From 18958d9f2b41d7aa1035867bc1a5dfb818ddd945 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Sun, 2 Oct 2022 02:13:25 +0100 Subject: [PATCH] #6 add how to do openshift ingress/route for frontent http access --- openshift/README.md | 29 ++++++++++++++++++++++++++++- openshift/route.yaml | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/openshift/README.md b/openshift/README.md index ca43df7..f4a5c5e 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -20,7 +20,7 @@ For that to work, configure your terminal to use `oc` CLI against your Openshift # Deploy OBP-API to your OpenShift Cluster -1. Ensure your secrets are configured as intended (see `obp.yaml`) +1. Ensure your secrets are configured as intended (see [`obp.yaml`](#openshift/obp.yaml)) 2. Apply the OBP manifest(s) to your k8s cluster A quickstart valid OBP-API deployment manifest is provided: @@ -35,6 +35,33 @@ Validate: oc get pods ``` +## Configure routing to web interface + +This will generate a frontent url for your app, which you may then use as a DNS `CNAME` +for ingress traffic. + +> Openshift doesn't appear to use the [standard](https://xkcd.com/927/) Kubernetes [ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) way of defining routes to applications, and uses a ["`kind: Reoute`" concept instead](https://cloud.redhat.com/blog/kubernetes-ingress-vs-openshift-route). Therefore we provide a special `route.yaml` for special OpenShift: + +Apply the route: +``` +oc apply -f route.yaml +route.route.openshift.io/obp-frontend created +``` + +View the assigned route address: +``` +oc get route obp-frontend +``` + +Example output: + +``` +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD +obp-frontend obp-frontend-chrisjsimpson-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com obpapi-service None +``` + +You may then choose to configure your DNS, adding a `CNAME` for the generated route to the app web frontend. + # Deploy OBP API to your local development environment diff --git a/openshift/route.yaml b/openshift/route.yaml index 371f12b..626946f 100644 --- a/openshift/route.yaml +++ b/openshift/route.yaml @@ -1,4 +1,4 @@ -apiVersion: v1 +apiVersion: route.openshift.io/v1 kind: Route metadata: name: obp-frontend