OpenShift 3 Deploying Application

From Dogtag
Jump to: navigation, search

Golang Hello Universe

To deploy gohellouniverse:

$ oc create -fhttps://raw.githubusercontent.com/tnozicka/gohellouniverse/master/deploy/{deployment,service}.yaml
$ oc expose svc/gohellouniverse

Open http://gohellouniverse-myproject.<IP address>.nip.io.

To enable TLS using OpenShift ACME:

$ oc patch route gohellouniverse -p '{"metadata":{"annotations":{"kubernetes.io/tls-acme":"true"}}}'

To undeploy gohellouniverse:

$ oc delete routes/gohellouniverse
$ oc delete svc/gohellouniverse
$ oc delete deployment.apps/gohellouniverse

Node.js Example

To deploy nodejs-ex:

$ oc new-app https://github.com/sclorg/nodejs-ex -l name=myapp
$ oc expose svc/nodejs-ex

Open http://nodejs-ex-myproject.<IP address>.nip.io.

To undeploy nodejs-ex:

$ oc delete routes/nodejs-ex
$ oc delete svc/nodejs-ex
$ oc delete dc/nodejs-ex
$ oc delete is/nodejs-ex
$ oc delete bc/nodejs-ex

See Also