Skip to content

Latest commit

 

History

History
187 lines (141 loc) · 6.87 KB

instruction.adoc

File metadata and controls

187 lines (141 loc) · 6.87 KB

OpenShift Racing Challenge

Prerequisites

The following CLI tools are required for accomplishing the tasks in this challenge. Please have them installed and configured before you get started with any of the tasks.

Tool Installation Doc

git

Download

skopeo

Download

oc

Download

helm

Download

ansible

Download

kubeseal

Download

Access to OpenShift

You will get the details of the OpenShift environment from your team facilitator. After gaining the access, please login to your OpenShift cluster and start the tasks.

✅ Operator Installation

Operator Channel

OpenShift GitOps

latest

OpenShift Pipelines

latest

AMQ Streams

stable

Sealed Secrets

*

🥸 HINT: please follow the https://github.com/bitnami-labs/sealed-secrets#installation[instructions] to install sealed-secrets controller in `kube-system` namespace via Helm Chart.
👻 BONUS TASK: consider different ways to install operators on OpenShift, and explain the different methods to the facilitator to get the points.

✅ Grant cluster-admin to OpenShift GitOps application controller service account

✅ Deploy reloader Helm Chart

Follow the command:

helm repo add stakater https://stakater.github.io/stakater-charts
helm repo update
helm install reloader stakater/reloader -n reloader --set reloader.isOpenshift=true --set reloader.deployment.securityContext.runAsUser=null --create-namespace

🔥 The challenge is getting real

Note
the GitHub and Quay Setup can be done in parallel

GitHub SetUp

git clone <your-forked-repos>

Quay SetUp

  • Use skopeo copy to mirror the container image to your own quay registry:

skopeo copy docker://quay.io/stbenji/quinoa-wind-turbine docker://quay.io/<your-account>/quinoa-wind-turbine

Racing car deployment

  • Create the namespace: quinoa-wind-turbine

  • The following steps will be executed in the same namespace

  • Go to the cloned quinoa-wind-turbine-manifests repo directory on your local machine

  • (provided that you are logged in to OpenShift on your local as well)

  • Use the following command to create the deployment secret:

helm template helm -n quinoa-wind-turbine --set disableSecretsDeployment=false -s templates/env/secret.yaml | kubeseal -n quinoa-wind-turbine  - > config/sealedsecret.yaml

oc apply -f config/sealedsecret.yaml
  • Create the argocd application using the wind-turbine-app-tmpl.yaml

  • Once you are sure that all the components of the application is running smoothly, use the following command to get the route of the racing car game:

echo "The dashboard link: https://$(oc get route quinoa-wind-turbine -o jsonpath='{.spec.host}{"\n"}' -n quinoa-wind-turbine)/dashboard"

echo "The game link: https://$(oc get route quinoa-wind-turbine -o jsonpath='{.spec.host}{"\n"}' -n quinoa-wind-turbine)"
  • Open a web browser to access the dashboard link to start the game

  • Use your mobile to access the game link to play the game

👻 BONUS TASK 1

GitHub SetUp

Name

Access

Administration

Read Only

Metadata

Read Only

Content

Read and Write

Commit Statuses

Read and Write

Webhooks

Read and Write

  • Ideally, set repository access to only select repositories, and select the repositories that you just forked

  • Go to your cloned quinoa-wind-turbine-manifests repo folder

  • Update the 0-github-secret-tmpl.yaml to create a secret named git-user-pass

  • Update the 0-quay-secret-tmpl.yaml to create a secret named quay-push-secret

  • Link both secret to pipeline service account

    🥸 HINT: *oc secret link*
  • Go to the foked quinoa-wind-turbine repo on GitHub and create a webhook in your GitHub repository

  • Go to Repository → Settings → Webhooks → Add webhook

  • Payload URL:

echo "http://$(oc get route el-wind-turbine -o jsonpath='{.spec.host}{"\n"}' -n quinoa-wind-turbine)"
  • Content type: application/json

  • You can ignore the secret field

  • Just push event is enough

  • Create the webhook

Quay SetUp

  • Create a robot account

  • Once the robot account is ready, click on the account and copy/download the Kubernetes Secret credentials

  • Add the robot account to the image repository and give it Write permission

Racing car modification

  • Go to your cloned quinoa-wind-turbine repo folder

  • Change const in the src/main/webui/src/Config.js e.g. `export const ENABLE_SHAKING = true;

  • Commit and push the change

  • Observe the pipelineruns in the namespace

  • Observe the Argo CD application rollout

  • Reload the game when the application is ready

  • If you can explain the underlying architecture of the application deployment workflow, you know what you are gonna get 😏

THE END 🥳 🥳 🥳

Thank you so much for participating!! 🎉🎉🎉