Giter VIP home page Giter VIP logo

rh-workshops's Introduction

Red Hat Workshops, but make it spicy

Deploy to DigitalOcean Kubernetes

Red Hat Workshops are a great open source collection of educational materials that cover various topics relating to Red Hat's product portfolio, from Automation with Ansible to Containers and Kubernetes with OpenShift. There is a set of resources to deploy the workshop environments, currently supported by IBM Cloud.

Workshop Listing

Currently Available and Supported Workshops

  • Ansible Automation

Workshops that need maintenance

  • Containers 101
  • DevOps on OpenShift (Screenshot updates for OCP)
  • DevSecOps/SSF
  • OpenShift 101 (Screenshot updates for OCP)

Available but Untested

  • Container Security
  • Linux Containers the Hard Way
  • OpenShift Security Workshop
  • OpenShift Service Mesh
  • RHEL 8
  • SELinux Policies

NOTE: Some of the workshop catalog items are from the Red Hat Gov Workshops and thus either haven't been tested recently on this platform, on the IBM Cloud, or on the latest OpenShift version where applicable. AWS deployment options may be available.

Deploying This Workshop Curriculum Platform

The live site at learn.kemo.network is deployed to a Kubernetes cluster - any will do. The manifest files can be found in scripts/kubernetes/.

The container is built on a Red Hat UBI that runs Apache HTTPd and serves up the static content generated by Hugo.

Outside of Hugo, there is some Javascript in the workshop curriculm platform to manage participant "logins", activity around the site, and to manage workshop auto-configuration assets from Jig. Jig is the backend service that powers this platform.

Both the curriculm and Jig can be run locally, from a container, or in a Kubernetes cluster.

Local/VM Deployment

Assuming you're starting with a fresh Fedora 32 instance, the following commands will clone down the repo, install the needed Asciidoc and NodeJS:

## Install packages
sudo dnf install -y git asciidoc rubygem-asciidoctor nodejs npm

## Clone down repo
git clone https://github.com/kenmoini/rh-workshops
cd rh-workshops

## Install Frontend Scripts
cd themes/pf4-redhat/static/
npm install
cd ../../..

## Build Site
bin/hugo

## Deploy with httpd/nginx/etc or run:
hugo serve

Navigate your browser to http://localhost:1313 to access the workshop curriculum site.

NOTE: You will still need to modify the config.toml file to match a deployed Jig backend in order to access the functions of logins, activity analysis, and workshop auto-configuration. Jig can also be deployed locally.


Deployment as a Container Image

In the root of this repository, you'll find a Dockerfile which can be used to build a container image:

podman build -t rh-workshops .
podman run -p 8080:8080 rh-workshops

Navigate your browser to http://localhost:8080 to access the running container.

NOTE: The Jig backend endpoint is defined in the Hugo config which is consumed during static site generation in the container builder layer. In order to override it when deployed as a container you will need to mount a volume to /var/www/html/js/container/ containing a jig-backend-override.js file that has the following:

const jigBackendEndpoint = "https://jig.example.com"

Deployment to Kubernetes

Assuming you have a Kubernetes cluster that has an nginx-ingress Ingress Controller the manifests found in the scripts/kubernetes/ folder should deploy this workshop curriculum platform, pulling the container image from quay.io/repository/kenmoini/rh-workshops.

To override the deployed Jig backend endpoint variable create a ConfigMap with the following:

apiVersion: v1
kind: ConfigMap
metadata:
  name: jigBackendEndpointCM
  namespace: rh-workshops
data:
  jig-backend-override.js: |
    const jigBackendEndpoint = "https://jig.example.com"

And modify the Deployment to look as follows:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rh-workshops
  namespace: rh-workshops
  labels:
    app: rh-workshops
    app.kubernetes.io/name: rh-workshops
    app.kubernetes.io/part-of: rh-workshops
spec:
  selector:
    matchLabels:
      app: rh-workshops
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: rh-workshops # has to match .spec.selector.matchLabels
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        - name: rh-workshops
          imagePullPolicy: Always
          image: quay.io/kenmoini/rh-workshops:latest
          ports:
            - containerPort: 8080
              name: web
          volumeMounts:
          - name: jigBackendEndpointJS
            mountPath: "/var/html/www/js/container"
            readOnly: true
      volumes:
        - name: jigBackendEndpointJS
          configMap:
            name: jigBackendEndpoint
            items:
              - key: "jig-backend-override.js"
                path: "jig-backend-override.js"

Deploy using kustomize

Install kustomize

kustomize

$ curl -s "https://raw.githubusercontent.com/\
kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
$ sudo mv kustomize /usr/local/bin/

Deploy to kubernetes using kustomize

Validate Configs

kustomize build scripts/overlay/kubernetes/ | less

Deploy

kustomize build scripts/overlay/kubernetes/ | kubectl create -f -

Delete deployment

kustomize build scripts/overlay/kubernetes/ | kubectl delete -f -

Deploy to OpenShift using kustomize

Validate Configs

kustomize build scripts/overlay/openshift/ | less

Deploy

kustomize build scripts/overlay/openshift/ | oc create -f -

Delete deployment

kustomize build scripts/overlay/openshift/ | oc delete -f -

New Workshop Development

Coming soon...


Contributing

If you have content that you'd like to contribute, check out the contribution guidelines for this project.

rh-workshops's People

Contributors

kenmoini avatar tosin2013 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.