This project provides a simple interface for running a lab environments on babylon for events where users are not expected to have authentication credentials. The Babylon events console automatically provisions a unique lab environment to each user that connects to the console interface and provides an administrative interface for those running the lab.
This project includes an OpenShift template, deploy-template.yaml
, for configuring and deploying the babylon events console.
The following template parameters are used to configure the console:
Parameter | Default | Description |
---|---|---|
NAME |
"babylon-events-console" |
Name to apply to OpenShift resources (deployment, service, route, etc.). |
ACCESS_PASSWORD |
none |
Optional access password if event users need to provide an access code to begin a lab. |
ACCESS_IP_NETWORKS |
none |
Optional comma separated list of permitted IP networks in CIDR format. |
ADMIN_PASSWORD |
generated string |
Administrative password. Users with this password may manage lab environments for all users. |
BOOKBAG_IMAGESTREAM_NAME |
none |
Image Stream with Bookbag image for lab. If provided then bookbag pods will be created automatically. |
BOOKBAG_IMAGESTREAM_NAMESPACE |
none |
Image Stream namespace for Bookbag image stream. If not provided then deployment namespace will be used. |
BOOKBAG_TEMPLATE_NAME |
|
Bookbag deployment template. Only used if image stream is provided. |
BOOKBAG_TEMPLATE_NAMESPACE |
|
Bookbag deployment template namespace. |
CATALOG_TEMPLATE_NAME |
none |
Babylon AgnosticV catalog item template name to provision for users. If not provided then lab environment data must be provided manually. |
CATALOG_TEMPLATE_NAMESPACE |
`openshift' |
Babylon AgnosticV catalog item template namespace. |
CATALOG_TEMPLATE_PARAMETERS |
|
Parameters to pass to template when creating user lab environments. Provide parameters as a JSON or YAML dictionary. |
CATALOG_TEMPLATE_QUOTA |
|
Limit applied to number of catalog items that can be provisioned through the UI. |
HOSTNAME |
none |
Hostname for events ui route. Route hostname will be generated if not provided. |
OPERATOR_IMAGE |
|
Image for babylon events operator. |
OPERATOR_IMAGE_PULL_POLICY |
|
|
OPERATOR_CPU_LIMIT |
|
Operator container cpu limit. |
OPERATOR_MEMORY_LIMIT |
|
Operator container memory limit. |
OPERATOR_CPU_REQUESTS |
|
Operator container cpu request. |
OPERATOR_MEMORY_REQUESTS |
|
Operator container memory request. |
UI_IMAGE |
|
|
UI_IMAGE_PULL_POLICY |
|
|
UI_CPU_LIMIT |
|
UI container cpu limit. |
UI_MEMORY_LIMIT |
|
UI container memory limit. |
REDIS_IMAGE |
|
Image for Redis database used for UI session tracking. |
REDIS_PASSWORD |
generated string |
Password for the Redis database. Care should be taken to explictly provide the redis password if reapplying template to avoid changing this value. |
REDIS_CPU_LIMIT |
|
Redis container cpu limit. |
REDIS_MEMORY_LIMIT |
|
Redis container memory limit. |
REDIS_VOLUME_CAPACITY |
|
Volume space available for session data, e.g. 512Mi, 2Gi. |
LAB_ENV_PREASSIGNMENT |
|
Whether lab environments are pre-assigned, disabling dynamic assignment. Value must be "true" or "false" |
LAB_START_TIME |
none |
Datetime string in iso8601 format for lab start time. |
These are the primary parameters for using the template. Additional parameters for advanced usage are available and documented within the template.
To deploy the Babylon events console from the command line:
oc process --local -f deploy-template.yaml \ -p NAME="babylon-events" \ -p CATALOG_TEMPLATE_NAMESPACE="gpte" \ -p CATALOG_TEMPLATE_NAME="tests.babylon-empty-config.dev" \ -p ACCESS_PASSWORD="MySecret" \ -p ADMIN_PASSWORD="AdminSecret" \ -p LAB_ENV_PREASSIGNMENT="true" \ -p LAB_START_TIME="2020-04-21T00:00:00Z" \ | oc apply -f -
+
NOTE: You should pass ADMIN_PASSWORD
and REDIS_PASSWORD
parameters if deploying repeatedly to avoid the auto-generation of values from the template defaults.
Once deployed, get the route hostname for the lab console. The same hostname should be provided to each student.
oc get route babylon-events-console -o custom-columns=HOST:{.spec.host}
If you deployed the console without an access password then you should keep this hostname secret until it is time for the start of the lab. A separate lab console in a separate namespace should be used for each lab session.
-
Use the
ocp4-disconnected-lab
namespace.oc project ocp4-disconnected-lab
-
Create events console build configuration
oc process --local -f build-template.yaml | oc apply -f -
-
Build events ui image
oc start-build babylon-events-ui --from-dir=. -F
-
Build events operator image
oc start-build babylon-events-operator --from-dir=. -F
-
Deploy events console from build image.
OPERATOR_IMAGE=$(oc get imagestream babylon-events-operator -o jsonpath='{.status.tags[?(@.tag=="latest")].items[0].dockerImageReference}') UI_IMAGE=$(oc get imagestream babylon-events-ui -o jsonpath='{.status.tags[?(@.tag=="latest")].items[0].dockerImageReference}') oc process --local -f deploy-template.yaml \ -p NAME="babylon-events" \ -p BOOKBAG_IMAGESTREAM_NAME="bookbag" \ -p CATALOG_TEMPLATE_NAMESPACE="gpte" \ -p CATALOG_TEMPLATE_NAME="tests.babylon-empty-config.dev" \ -p ADMIN_PASSWORD="r3dh4t1!" \ -p REDIS_PASSWORD="r3d1sS3cr3t" \ -p OPERATOR_IMAGE="${OPERATOR_IMAGE}" \ -p UI_IMAGE="${UI_IMAGE}" \ -p LAB_ENV_PREASSIGNMENT="true" \ -p LAB_START_TIME="2020-04-23T00:00:00Z" \ | oc apply -f -
NoteYou should pass ADMIN_PASSWORD
andREDIS_PASSWORD
parameters if deploying repeatedly to avoid the auto-generation of values from the template defaults.