This is a quick how-to guide for deploying a very simple hello-world web application on OpenShift and expose it over HTTPS . You can follow the same approach to expose any application securely overly HTTPS.
The POD and Service YAML for the hello-world application is given below.
- name: hello-world
- name: pull-secret---kind: Service
- port: 5678
Once this is deployed you’ll have a “hello-world-service”
$ oc get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-world-service ClusterIP 172.30.67.133 <none> 5678/TCP 29s
In order to expose this service securely over HTTPS, all you have to do is create an “edge” route as shown below:
$ oc create route edge --service=hello-world-serviceroute.route.openshift.io/hello-world-service created
Find out the full service URL by running the following command:
$ oc get routes/hello-world-service -o json | jq -r '.spec.host'hello-world-service-sample.apps.bpradipt-bef188.8.131.52.108.sslip.io
For more advanced configuration on “edge” routes like using custom certificates please refer to the official OpenShift docs.