Skip to content

Red Hat Workshops - a Hugo static site, with a pound of JS to coordinate with Jig

License

Notifications You must be signed in to change notification settings

kenmoini/rh-workshops

Repository files navigation

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"

New Workshop Development

Coming soon...


Contributing

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

About

Red Hat Workshops - a Hugo static site, with a pound of JS to coordinate with Jig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published