Lab - Run the App

Return to Workshop

Step 1 - Create a Route to the Gochat Service

First we expose the pod with a service.

oc expose dc wetty --port=8080 --target-port=8080 --name=gochat

Then we expose the service with a route.

oc expose svc gochat

Step 2 - Download the App Source

go get -d github.com/kevensen/openshift-gochat-client

Step 3 - Build the App

cd go/src/github.com/kevensen/openshift-gochat-client
glide install -v && go install

Step 4 - Annotate the Service Account to Use OpenShift Authorization

These annotations allow for the Gochat Client to communicate to the OpenShift API for user credential verification.

oc annotate sa/default serviceaccounts.openshift.io/oauth-redirectreference.1='{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"gochat"}}' --overwrite
oc annotate sa/default serviceaccounts.openshift.io/oauth-redirecturi.1=auth/callback/openshift --overwrite

Step 5 - Run the App

cd ~
openshift-gochat-client -host :8080 -chatServer gochat-server.gochat-server.svc.cluster.local:8080 -templatePath go/src/github.com/kevensen/openshift-gochat-client/templates -logtostderr -insecure

Step 6 - Access the App

Go back to the OpenShift WebUI and click on the "gochat" URL.

Step 7 - Sign in to the App

Click the blue "Login" button.

Log in to the app with your OpenShift credentials. The workshop moderator will provide you with the URL, your username, and password.

Step 8 - Test the App

Send a message!

Step 9 - Logout

Step 10 - Quit the App

In the Wetty terminal ctrl+c to stop the server.


Workshop Details

Domain Red Hat Logo
Workshop
Student ID

Return to Workshop