Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 4.3 KB

getting-started.adoc

File metadata and controls

78 lines (48 loc) · 4.3 KB

OpenShift Access

You should have access to an OpenShift cluster in order to get started with Bookbag development. While it is possible to develop bookbag without OpenShift, we recommend building and working inside of OpenShift so that you can see the full feature set of OpenShift Homeroom and so that you will understand how Bookbag is deployed in production. Any recent version of OpenShift is suitable.

This demo was developed using a local development environment with Red Hat CodeReady Containers.

If you have access to labs.opentlc.com, you may use the "OPENTLC OpenShift 4 Labs > OPENTLC OpenShift 4.4 Shared Access" catalog item to request access to a shared cluster.

In addition to OpenShift cluster access, you will need a terminal and the oc command to follow along with this demo.

If you are accessing this demo content running as bookbag within an OpenShift cluster then you have everything you need right here to get started.

Project Namespace

You will need a project namespace in OpenShift to deploy bookbag. We will be using bookbag-demo. After logging into your OpenShift cluster, switch to whatever project you will be using:

$ oc project bookbag-demo
Now using project "bookbag-demo" on server "https://api.crc.testing:6443".

If you do not already have a project namespace, you can create one with oc new-project:

$ oc new-project bookbag-demo
Now using project "bookbag-demo" on server "https://api.crc.testing:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app ruby~https://github.com/sclorg/ruby-ex.git

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node

Git Repository

The following GitHub template is provided as a starting point for bookbag development.

To use the template, simply click the image::media/github-use-this-template.png[Use This Template] button, select the owner, and provide a repository name. Lab and demo instruction content should be hosted in an organizationally managed repository rather than a personal repository. If you are developing a lab for a Red Hat event or for demo purposes and do not have a suitable GitHub organization then please contact GPTE to request a repository in the redhat-gpte-labs GitHub org.

Instructions in this demo assume this template repository is your starting point. If you have used a previous version of the bookbag-template, the main changes to watch for are:

  • Updated .workshop/build and envvars/terminal.sh

  • Build template now defaults to Dockerfile build.

  • Deploy template now creates a service account and grants a rolebinding for the service account.

  • New deploy template which includes OpenShift console access from bookbag.

Setting the Deploy Template

The bookbag-template includes two templates for deploying bookbag.

  • deploy-with-console-template.yaml - Deploy OpenShift Homeroom with pre-authenticated access to the OpenShift cluster console and edit access to the namespace.

  • deploy-no-console-template.yaml - Deploy OpenShift Homeroom without OpenShift console and only the most basic user access.

First select whether to use the template with OpenShift cluster access or the template without cluster access. There is a symbolic link provided that links deploy-template.yaml with deploy-no-console-template.yaml. Once you decide on a template we recommend that you remove this link and rename the selected deploy template file to deploy-template.yaml.

If desired you may edit either deploy template to change the default user access by setting the default value of the ROLE parameter in the template.