Skip to content

Commit

Permalink
Merge pull request #29 from smichard/master
Browse files Browse the repository at this point in the history
updated documentation
  • Loading branch information
nexus-Six authored Apr 3, 2024
2 parents d973dbd + 20c5306 commit c175e55
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 67 deletions.
4 changes: 4 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM --platform=linux/amd64 klakegg/hugo:alpine-onbuild AS hugo

FROM --platform=linux/amd64 quay.io/nginx/nginx-unprivileged:alpine3.18
COPY --from=hugo /target /usr/share/nginx/html
18 changes: 9 additions & 9 deletions content/1-intro/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ weight = 1

## Intro

This is the storyline you'll follow:
This is the storyline you are going to follow:

- Create application using the browser based development environment [Red Hat OpenShift Dev Spaces](https://developers.redhat.com/products/openshift-dev-spaces/overview)
- Create an application using the browser based development environment [Red Hat OpenShift Dev Spaces](https://developers.redhat.com/products/openshift-dev-spaces/overview)
- Setting up the **Inner Development Loop** for the individual developer
- Use the cli tool [odo](https://developers.redhat.com/products/odo/overview) to create, push, change apps on the fly
- Setting up the **Outer Development Loop** for the team CI/CD
- Setting up the **Outer Development Loop** for the CI/CD team
- Learn to work with OpenShift Pipelines based on Tekton
- Use OpenShift GitOps based on ArgoCD
- Secure your app and OpenShift cluster with **ACS**
- Introduction to ACS
- Example use cases
- Add ACS scanning to Tekton Pipeline
- Add ACS scanning to a Tekton Pipeline

## What to Expect

{{% notice tip %}}
This workshop is for intermediate OpenShift users. A good understanding of how OpenShift works along with hands-on experience is expected. For example we will not tell you how to log in with `oc` to your cluster or tell you what it is... ;)
{{% /notice %}}

We try to balance guided workshop steps and challenging you to use your knowledge to learn new skills. This means you'll get detailed step-by-step instructions for every new chapter/task, later on the guide will become less verbose and we'll weave in some challenges.
We try to balance guided workshop steps and challenge you to use your knowledge to learn new skills. This means you'll get detailed step-by-step instructions for every new chapter/task, later on the guide will become less verbose and we'll weave in some challenges.

## Workshop Environment

Expand All @@ -42,13 +42,13 @@ The easiest way to provide this environment is through the Red Hat Demo System.

### Self Hosted

While the workshop is designed to be run on Red Hat Demo System you should be able to run the workshop on a 4.10 cluster of you own.
While the workshop is designed to be run on Red Hat Demo System you should be able to run the workshop on a 4.10 cluster of your own.

Just make sure :

- You have cluster admin privileges
- Sizing
- 3 Master Nodes (Similar to AWS m5.2x.large)
- 3 Controlplane Nodes (Similar to AWS m5.2x.large)
- 2 Worker (Similar to AWS m5.4x.large)
- Authentication htpasswd enabled
- For the ACM chapter you will need AWS credentials to automatically deploy a SingleNode OpenShift
Expand All @@ -69,7 +69,7 @@ This workshop was tested with these versions :

## Workshop Flow

We'll tackle the topics at hand step by step with an introduction covering the things worked on before every section.
We'll tackle the topics at hand step by step with an introduction covering the things worked on before each section.

## And finally a sprinkle of JavaScript magic

Expand All @@ -83,7 +83,7 @@ You'll notice placeholders for cluster access details, mainly the **part of the

## URL Generator for Custom Lab Guide

Enter your Openshift url after the `apps` part (e.g. `cluster-t50z9.t50z9.sandbox4711.opentlc.com` ) and click the button to generate a link that will customize your lab guide.
Enter your OpenShift url after the `apps` part (e.g. `cluster-t50z9.t50z9.sandbox4711.opentlc.com` ) and click the button to generate a link that will customize your lab guide.

Click the generated link once to apply it the the current guide.

Expand Down
20 changes: 10 additions & 10 deletions content/2-install-prerequisites/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ But fear not, all are managed by Kubernetes [Operators](https://cloud.redhat.com

Let's install [OpenShift Data Foundation](https://www.redhat.com/en/technologies/cloud-computing/openshift-data-foundation) which you might know under the old name `OpenShift Container Storage`. It is engineered as the data and storage services platform for OpenShift and provides software-defined storage for containers.

- Login to the OpenShift Webconsole with you cluster admin credentials
- Login to the OpenShift Webconsole with your cluster admin credentials
- In the Web Console, go to **Operators > OperatorHub** and search for the `OpenShift Data Foundation` operator
{{< figure src="../images/odf-operator.png?width=50pc&classes=border,shadow" title="Click image to enlarge" >}}
- Install the operator with default settings
Expand All @@ -27,11 +27,11 @@ After the operator has been installed it will inform you to install a `StorageSy
- **Security and network**: Leave set to `Default (SDN)`
- Click **Next**

You'll see a review of your settings, hit `Create StorageSystem`. Don't worry if you see a temporary _404 Page_. Just releod the browser page once and your will see the System Overview
You'll see a review of your settings, hit `Create StorageSystem`. Don't worry if you see a temporary _404 Page_. Just releod the browser page once and you will see the System Overview

{{< figure src="../images/odf-systems.png?width=50pc&classes=border,shadow" title="Click image to enlarge" >}}

As mentioned already this takes some time so go ahead and install the other prerequisites. We'll come back later.
As mentioned already this takes some time, so go ahead and install the other prerequisites. We'll come back later.

## Prepare to run oc commands

Expand All @@ -41,11 +41,11 @@ You will be asked to run `oc` (the OpenShift commandline tool) commands a couple

To extend OpenShift with the Web Terminal option, install the **Web Terminal** operator:

- Login to the OpenShift Webconsole with you cluster admin credentials
- Login to the OpenShift Webconsole with your cluster admin credentials
- In the Web Console, go to **Operators > OperatorHub** and search for the **Web Terminal** operator
- Install the operator with default settings
- Install the operator with the default settings

This will take some time and installs another operator as dependency.
This will take some time and installs another operator as a dependency.

After the operator has installed, reload the OCP Web Console browser window. You will now have a new button (**>\_**) in the upper right. Click it to start a new web terminal. From here you can run the `oc` commands when the lab guide requests it (copy/paste might depend on your laptop OS and browser settings, e.g. try `Ctrl-Shift-V` for pasting).

Expand Down Expand Up @@ -73,9 +73,9 @@ We'll need Git repository services to keep our app and infrastructure source cod
To integrate the `Gitea` operator into your Operator catalog you need to access your cluster with the `oc` client. You can do this in two ways:

- If you don't already have the oc client installed, you can download the matching version for your operating system [here](https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/)
- Login to the OpenShift Webconsole with you cluster admin credentials
- Login to the OpenShift Web Console with you cluster admin credentials
- On the top right click on your username and then **Copy login command** to copy your login token
- On you local machine open a terminal and login with the `oc` command you copied above
- On you local machine open a terminal and login with the `oc` command you copied above, you may need to add **--insecure-skip-tls-verify** at the end of the line

Or, if working on a Red Hat RHPDS environment:

Expand Down Expand Up @@ -162,7 +162,7 @@ The image that we have just deployed was pushed to the internal OpenShift Regist
Quay installation is done through an operator, too:

- In **Operators->OperatorHub** filter for `Quay`
- Install the **Red Hat Quay** operator with default settings
- Install the **Red Hat Quay** Operator with the default settings
- Create a new project called `quay` at the top Project selection menu
- While in the project `quay` go to **Administration->LimitRanges** and delete the `quay-core-resource-limits`
{{< figure src="../images/delete-limit-range.png?width=45pc&classes=border,shadow" title="Click image to enlarge" >}}
Expand All @@ -181,7 +181,7 @@ Now that the Registry is installed you have to configure a superuser:
- Click **Create Account**
- As username put in `quayadmin`, a (fake) email address and and `quayadmin` as password.
- Click **Create Account** again
- In the OpenShift web console open **Workloads->Secrets**
- In the OpenShift Web Console open **Workloads->Secrets**
- Search for `quay-config-editor-credentials-...`, open the secret and copy the values, you'll need them in a second.
- Go back to the **Routes** and open the `quay-quay-config-editor` route
- Login with the values of the secret from above
Expand Down
2 changes: 1 addition & 1 deletion content/2.1-prepare-cluster/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Now create a new secret for the Quay Bridge to access Quay. In the OpenShift web
- Go to **Workloads->Secrets** and click **Create->Key/value secret**
- **Secret name**: quay-credentials
- **Key**: token
- **Value**: paste the Access Token you generated in the Quay Portal in the shite text field below the grey _Value_ field
- **Value**: paste the Access Token you generated in the Quay Portal in the text field below the grey _Value_ field
- Click **Create**

And you are done with the installation and integration of Quay as your registry!
Expand Down
28 changes: 15 additions & 13 deletions content/3-inner-loop/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ In this part of the workshop you'll experience how modern software development u

## Install and Prepare Red Hat OpenShift Dev Spaces

**OpenShift Dev Spaces** is a browser-based IDE for Cloud Native Development. All the heavy lifting is done though a container running your workspace on OpenShift. All you really need is a laptop. You can easily switch and setup customized environment, plugin, build tools and runtimes. So switching from one project context to another is as easy a switching a website. No more endless installation and configuration marathons on your dev laptop. It is already part of your OpenShift subscription. If you want to find out more have a look [here](https://developers.redhat.com/products/openshift-dev-spaces/overview)
**OpenShift Dev Spaces** is a browser-based IDE for Cloud Native Development. All the heavy lifting is done through a container running your workspace on OpenShift. All you really need is a laptop. You can easily switch and setup a customized environment, plugin, build tools and runtimes. So switching from one project context to another is as easy a switching a website. No more endless installation and configuration marathons on your dev laptop. It is already part of your OpenShift subscription. If you want to find out more have a look [here](https://developers.redhat.com/products/openshift-dev-spaces/overview)

- Install the **Red Hat OpenShift Dev Spaces** Operator from OperatorHub (not the previous Codeready Workspaces versions!) with default settings
- Go to **Installed Operators -> Red Hat OpenShift Dev Spaces** and create a new instance (**Red Hat OpenShift Dev Spaces instance Specification**) using the default settings in the project `openshift-operators`
- Wait until deployment has finished. This may take a couple of minutes as several components will be deployed.
- Once the instance status is ready (You can check the YAML of the instance: `status > chePhase: Active`), look up the `devspaces` Route in the `openshift-workspaces` project (If you can see the `openshift-workspaces`, you may need to toggle the **Show default project** button).
- Open the link in a new browser tab, click on **Log in with OpenShift** and log in with your OCP credentials
- Open the link in a new browser tab, click on **Log in with OpenShift** and log in with your OpenShift credentials
- Allow selected permissions

{{% notice tip %}}
We could create a workspace from one of the templates that come with DevSpaces, but we want to use a customized workspace with some additionally defined plugins in a [v2 devfile](https://devfile.io/) in our git repo. With devfiles you can share a complete workspace setup and with the click of a link and you will end up in a fully configured project in your browser.
We could create a workspace from one of the templates that come with Dev Spaces, but we want to use a customized workspace with some additionally defined plugins in a [v2 devfile](https://devfile.io/) in our git repo. With devfiles you can share a complete workspace setup and with the click of a link and you will end up in a fully configured project in your browser.
{{% /notice %}}

- In the left menu click on **Create Workspace**
Expand All @@ -40,7 +40,8 @@ While working with Dev Spaces make sure you have AdBlockers disabled, you are no
As an example you'll create a new Java application. You don't need to have prior experience programming in Java as this will be kept really simple.

{{% notice tip %}}
We will use a Java application based on the [Quarkus](https://quarkus.io/) stack. Quarkus enables you to create much smaller and faster containerized Java applications than ever before. You can even transcompile these apps to native Linux binaries that start blazingly fast. The app that we will use is just a starter sample created with the [Quarkus Generator](https://code.quarkus.io/) with a simple RESTful API that answers to http Requests. But at the end of the day this setup will work with any Java application. **Fun fact:** Every OpenShift Subscription already comes with a Quarkus Subscription.
We will use a Java application based on the [Quarkus](https://quarkus.io/) stack. Quarkus enables you to create much smaller and faster containerized Java applications than ever before. You can even transcompile these apps to native Linux binaries that start blazingly fast. The app that we will use is just a basic example created with the [Quarkus Generator](https://code.quarkus.io/) with a simple RESTful API that answers to http requests. But at the end of the day this setup will work with any Java application.
**Fun fact:** Every OpenShift Subscription already provides a Quarkus Subscription.
{{% /notice %}}

Let's clone our project into our workspace :
Expand Down Expand Up @@ -77,17 +78,17 @@ oc new-project workshop-dev

## Use odo to Deploy and Update our Application

**odo** or 'OpenShift do' is a cli that enables developers to get started quickly with cloud native app development without being a Kubernetes expert. It offers support for multiple runtimes and you can easily setup microservice components, push code changes into running containers and debug remotely with just a few simple commands. To find out more, have look [here](https://odo.dev/)
**odo** or 'OpenShift do' is a cli that enables developers to quickly get started with cloud native app development without being a Kubernetes expert. It offers support for multiple runtimes and you can easily setup microservice components, push code changes into running containers and debug remotely with just a few simple commands. To find out more, have look [here](https://odo.dev/)

First we need to make sure we are folder of the cloned project.
First we need to make sure we are in the folder of the cloned project.

Enter
Enter the following command in the terminal:

```
pwd
```

if you are not in the `/projects/quarkus-build-options` folder, change into with the cd command
if you are not in the `/projects/quarkus-build-options` folder, change into with the `cd` command

**odo** is smart enough to figure out what programming language and frameworks you are using. So let's let initialize our project

Expand All @@ -100,7 +101,7 @@ odo init
- You can select a container in which odo will be started. Hit **Enter** (None)
- As componenten name keep the suggestion. Hit **Enter**

**odo** is not intialized for your app. Let's deploy the app to openshift in odo dev mode
**odo** is now intialized for your app. Let's deploy the app to openshift in odo dev mode

```
odo dev
Expand All @@ -114,17 +115,18 @@ There will be a couple of popups in the bottom right corner

- "A new process is listening ..." -> Choose **Yes**
- "Redirect is not enabled ..." --> Click on **Open in New Tab**
- "Do you want VS Code - Open SOurce to open an external website" --> Choose **Open**
- "Do you want VS Code - Open Source to open an external website" --> Choose **Open**

A new tab will open and show the webpage of your app. You may have to wait a reload in a few seconds.

To test the app:

Your app should show up as a simple web page. In the `RESTEasy JAX-RS` section click the `@Path` endpoint `/hello` to see the result.
Your app should be displayed as a simple web page. In the `RESTEasy JAX-RS` section click the `@Path` endpoint `/hello` to see the result.

Now for the fun part: Using `odo` you can just dynamically change your code and push it out again without doing a new image build! No dev magic involved:
Now for the fun part:
Using `odo` you can dynamically change your code and push it again without the need t o build a new container image! No dev magic involved:

- In your DevWorkspace on the left, expand the file tree to open file `src/main/java/org/acme/GreetingRessource.java` and change the string "Hello RESTEasy" to "Hello Workshop" (DevSpaces saves every edit directly. No need to save)
- In your DevWorkspace on the left, expand the file tree to open file `src/main/java/org/acme/GreetingRessource.java` and change the string "Hello RESTEasy" to "Hello Workshop" (DevSpaces auto saves every edit directly. No need to save the file manually.)

- And reload the app webpage.
- Bam! The change should be there in a matter of seconds
Expand Down
Loading

0 comments on commit c175e55

Please sign in to comment.