Giter Club home page Giter Club logo

openshift-ops-workshops's Introduction

OpenShift Operations Workshops

This repository contains lab instructions and supporting content for a series of administrative-focused workshops centered around OpenShift.

The workshops included in this repo are:

  • Red Hat OpenShift Container Platform 4 for Admins RHDP
  • Modern App Dev Roadshow - Ops Track RHDP / More Info
  • Summit 2023 Hands on with OCP Plus Workshop RHDP

If you are a Red Hat employee with access to RHDP, we recommend deploying using the provided RHDP links above.

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

openshift-ops-workshops's People

Contributors

dmesser avatar jnewsome97 avatar thoraxe avatar cooktheryan avatar kaovilai avatar netzzer avatar christianh814 avatar jalvarez-rh avatar kmurudi avatar mfosterrox avatar jewzaam avatar mwoodson avatar ianpurdy avatar dlbewley avatar mulbc avatar jchraibi avatar paddy667 avatar steven-ellis avatar twiest avatar stencell avatar dobbymoodge avatar adetalhouet avatar aravindhp avatar ashtondavis avatar jamesfalkner avatar techjw avatar jmferrer avatar mdstjean avatar stevenbarre avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.