• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenShift and Container Storage for Administrators

This repository contains lab instructions and related supporting content for an administrative-focused workshop that deals with OpenShift and OpenShift Container Storage.

Requirements / Prerequisites

Doing these labs on your own requires a few things.

AWS

These labs are designed to run on top of an OpenShift 4 cluster that has been installed completely by the new installer. You will need access to AWS with sufficient permissions and limits to deploy the 3 masters, 4-6 regular nodes, and NVME-equipped nodes for storage.

Check out the documentation for Installing on AWS.

OpenShift 4

At this time an OpenShift 4 cluster can be obtained by visiting https://try.openshift.com -- a free "subscription" to / membership in the developer program is required.

Deploying the Lab Guide

Deploying the lab guide will take three steps. First, you will need to get information about your cluster. Second, you will build a container based on your lab. Third, you will deploy the lab guide using the information you found so that proper URLs and references are automatically displayed in the guide.

Required Environment Variables

Most of the information can be found in the output of the installer.

Explaination and examples

  • API_URL - URL to access API of the cluster
    • https://api.cluster-gu1d.sandbox101.opentlc.com:6443
  • MASTER_URL - Master Console URL
    • http://console-openshift-console.apps.cluster-gu1d.sandbox101.opentlc.com
  • KUBEADMIN_PASSWORD - Password for kubeadmin
  • SSH_PASSWORD - password for ssh into bastion
  • ROUTE_SUBDOMAIN - Subdomain that apps will reside on
    • apps.cluster-gu1d.sandbox101.opentlc.com:6443
    • apps.mycluster.company.com

Specific to Red Hat internal systems

  • GUID - GUID
    • gu1d
  • BASTION_FQDN - Bastion Domain Name
    • bastion.gu1d.sandbox101.opentlc.com

Create a file called workshop-settings.sh using the values of your environment. Here is an example.

⚠️ For export ensure special characters are escaped (ie. use \! in place of !).

API_URL=https://api.openshift4.example.com:6443
MASTER_URL=https://console-openshift-console.apps.openshift4.example.com
KUBEADMIN_PASSWORD=IqJK7-o3hYR-ZTr6c-7sztN
SSH_USERNAME=lab-user
SSH_PASSWORD=apassword
BASTION_FQDN=foo.bar.com
GUID=XXX
ROUTE_SUBDOMAIN=apps.openshift4.example.com
HOME_PATH=/opt/app-root/src

Deploy the Lab Guide

Now that you have the workshop-settings.sh file with the various required variables, you can deploy the lab guide into your cluster.

First, clone the repo

NOTE Remember to checkout the branch you want to test against

git clone https://github.com/openshiftdemos/openshift-ops-workshops

Next, Build a container using the repo/branch you checked out.

cd openshift-ops-workshops
export QUAY_USER=myusername
export BRANCH=$(git branch --show-current)
podman build -t quay.io/${QUAY_USER}/lab-sample-workshop:${BRANCH} .

Now, login to quay (it's free to sign up) or another registry your cluster has access to.

podman login quay.io

Next push your container to your repo.

podman push quay.io/${QUAY_USER}/lab-sample-workshop:${BRANCH}

You will use this image to deploy the lab. The following command will log you in as kubeadmin on systems with oc client installed:

oc login -u kubeadmin -p $KUBEADMIN_PASSWORD

oc new-project lab-ocp-cns

# This part is needed if you're running on a "local" or "self-provisioned" cluster
oc adm policy add-role-to-user admin kube:admin -n lab-ocp-cns

# Create deployment.
oc new-app -n lab-ocp-cns https://raw.githubusercontent.com/redhat-cop/agnosticd/development/ansible/roles/ocp4-workload-workshop-admin-storage/files/production-cluster-admin.json \
--param TERMINAL_IMAGE="quay.io/${QUAY_USER}/lab-sample-workshop:${BRANCH}" --param PROJECT_NAME="lab-ocp-cns" \
--param WORKSHOP_ENVVARS="$(cat ./workshop-settings.sh)"

# Wait for deployment to finish.

oc rollout status dc/dashboard -n lab-ocp-cns

If you made changes to the container image and want to refresh your deployed Homeroom quickly, execute this:

oc import-image -n lab-ocp-cns dashboard

Doing the Labs

Your lab guide should deploy in a few moments. To find its url, execute:

oc get route dashboard -n lab-ocp-cns

You should be able to visit that URL and see the lab guide. From here you can follow the instructions in the lab guide.

Notes and Warnings

Remember, this experience is designed for a provisioning system internal to Red Hat. Your lab guide will be mostly accurate, but slightly off.

  • You aren't likely using lab-user
  • You will probably not need to actively use your GUID
  • You will see lots of output that references your GUID or other slightly off things
  • Your MachineSets are different depending on the EC2 region you chose

But, generally, everything should work. Just don't be alarmed if something looks mostly different than the lab guide.

Also note that the first lab where you SSH into the bastion host is not relevant to you -- you are likely already doing the exercises on the host where you installed OpenShift from.

Troubleshooting

Make sure you are logged-in as kubeadmin when creating the project

If you are getting too many redirects error then clearing cookies and re-login as kubeadmin. This usually happens if you're using RHPDS and stopped/started a cluster.

Cleaning up

To delete deployment run

oc delete all,serviceaccount,rolebinding,configmap -l app=admin -n labguide

License

This repository and everything within it are licensed under the GNU General Public License (GPL) v3.0

More Repositories

1

os-sample-python

Sample Python Flask application for testing OpenShift 3 deployment using OpenShift default Python S2I builder and gunicorn.
Python
61
star
2

gogs-openshift-docker

A Docker setup for gogs.io with OpenShift in mind
Dockerfile
55
star
3

openshift-tasks

Sample JBoss EAP (WildFly) App for OpenShift
CSS
48
star
4

sonarqube-openshift-docker

An OpenShift-focused Docker build of Sonarqube
Shell
41
star
5

nexus

28
star
6

rhods-fraud-detection

A lab/workshop for Red Hat OpenShift Data Science using simple fraud detection as an example workload
Jupyter Notebook
20
star
7

demo-guide

A guide to all the official OpenShift demos and workshops
CSS
18
star
8

os-sample-java-web

Sample Java Web Application for use in OpenShift
Java
12
star
9

grafana-openshift

A grafana Dockerfile for OpenShift
Shell
11
star
10

blender-operator

An operator to handle various headless blender tasks in a Kubernetes cluster
Go
9
star
11

openshift-gitops-workshop

An introductory workshop covering OpenShift Gitops (based on ArgoCD)
JavaScript
9
star
12

argo-rollouts-workshop

A workshop for Argo Rollouts on OpenShift
Jinja
8
star
13

blender-remote

A quick and dirty attempt at running headless Blender on OpenShift
Shell
8
star
14

kubeflow-mpi-openfoam

Shell
6
star
15

gitlab-openshift-docker

An OpenShift-focused Docker build of Gitlab
Ruby
6
star
16

coolstore-portfolio

Java
5
star
17

workshop-provisioner

a provisioner pod for openshift workshops
Shell
3
star
18

ansible_gce_deployer

An Ansible-based deployer to provision an OpenShift environment on GCE
Python
2
star
19

ask-an-openshift-admin

The Ask an OpenShift Admin office hour livestream, https://red.ht/aoa
2
star
20

openshift_docker_deployer

A docker image that contains Ansible deployment scripts for OpenShift workshops
2
star
21

ToucanTTS-RHODS-voice-cloning

A proof-of-concept demonstration of using Red Hat OpenShift Data Science and the ToucanTTS project to clone a voice
Python
2
star
22

cockroachdb-kafka-eda-lab

A bookbag-based lab exploring CockroachDB, Red Hat AMQ, and Event-Driven Architectures
Shell
1
star
23

s2s-bookbag

A repository of workshop instructions for the AI/ML "stats to serverless" workshop
Shell
1
star
24

nexus-openshift-docker

Sonatype Nexus Docker Image with JBoss Enterprise repository pre-configured
1
star
25

centos-jdk8-maven-docker

Simply adds maven to jboss/base-jdk:8
1
star
26

containerizing-apps-2021

Shell
1
star