Tag Archives: OpenShift

OpenShift: add project route in web console using yaml example


As soon as I started using YAML for OpenShift configuration I didn’t turn back. It is so much simpler to handle. Project routes can be configured in the web console but you can also import YAML.

Here is an example of such a YAML:

01apiVersion: v1
02kind: Route
03metadata:
04  name: myapp
05  labels:
06    app: myapp
07    name: myapp
08spec:
09  host: mysuperdomain.se
10  path: /myapp
11  port:
12    targetPort: 8080-tcp
13  to:
14    kind: Service
15    name: myapp

NOTE! You need to setup a project service first so you have something to reference in the route (spec/to)

Tested on OpenShift Web Console: v3.11.153

OpenShift: add project service thru web console example

OpenShifts web console can do a lot but adding new project services is only done thru importing yaml file (or text)

Here is one example of such a yaml text

01apiVersion: v1
02kind: Service
03metadata:
04  name: myapp
05  labels:
06    app: myapp
07    name: myapp
08spec:
09  ports:
10    - name: 8080-tcp
11      port: 8080
12      protocol: TCP
13      targetPort: 8080
14  selector:
15    app: myapp
16    deploymentconfig: myapp
17  sessionAffinity: None
18  type: ClusterIP

Tested on OpenShift Web Console v3.11.153