Compare commits

...

4 Commits

Author SHA1 Message Date
d2876f2e17 Tidy up cluster setup instructions. 2023-12-08 14:43:56 +13:00
8aa8f8c551 Completed exercise 6. 2023-12-07 12:43:20 +13:00
0ac91e748d Add bonus objectives to some exercises. 2023-12-07 11:54:19 +13:00
3e2fc9b371 Confirm when each exercise is finished. 2023-12-07 11:43:21 +13:00
14 changed files with 86 additions and 29 deletions

View File

@ -29,7 +29,7 @@ To export the site to static html to serve for example via github pages, run:
npm install npm install
# Build and export the site # Build and export the site
npm run build && npm export npm run build && npm run export
#+end_src #+end_src
@ -39,7 +39,10 @@ The workshop expects an OpenShift 4.14 cluster with a few pre-requisites.
*** Add redhat-cop helm chart repository *** Add redhat-cop helm chart repository
#+begin_src yaml Required so the Gitea helm chart will be available for all users.
#+begin_src bash
cat << EOF | oc apply --filename -
apiVersion: helm.openshift.io/v1beta1 apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository kind: HelmChartRepository
metadata: metadata:
@ -48,12 +51,16 @@ spec:
connectionConfig: connectionConfig:
url: 'https://redhat-cop.github.io/helm-charts' url: 'https://redhat-cop.github.io/helm-charts'
name: Red Hat Community name: Red Hat Community
EOF
#+end_src #+end_src
*** Install web terminal operator *** Install web terminal operator
#+begin_src yaml So our workshop participants don't need to install ~oc~ locally.
#+begin_src bash
cat << EOF | oc apply --filename -
apiVersion: operators.coreos.com/v1alpha1 apiVersion: operators.coreos.com/v1alpha1
kind: Subscription kind: Subscription
metadata: metadata:
@ -65,23 +72,30 @@ spec:
name: web-terminal name: web-terminal
source: redhat-operators source: redhat-operators
sourceNamespace: openshift-marketplace sourceNamespace: openshift-marketplace
#startingCSV: web-terminal.v1.8.0-0.1692219820.p EOF
#+end_src #+end_src
*** Create an operatorgroup for each user *** Create an operatorgroup for each user
We want each user to be able to install the same operator so we can pre-create namespaces and seed them with OperatorGroups to reduce complexity.
#+begin_src bash #+begin_src bash
cat << EOF > operatorgroup.yaml cat << EOF > operatorgroup.yaml
apiVersion: operators.coreos.com/v1 apiVersion: operators.coreos.com/v1
kind: OperatorGroup kind: OperatorGroup
metadata: metadata:
name: grafana-og name: grafana-og
namespace: userX
spec: spec:
targetNamespaces: targetNamespaces:
- userX - user$user
upgradeStrategy: Default upgradeStrategy: Default
EOF EOF
for user in $(seq 1 30); do oc apply ...; done
for user in $(seq 1 30); do
export user=${user}
oc new-project user"${user}"
envsubst < operatorgroup.yaml | oc create --filename - --namespace user"${user}"
oc adm policy add-role-to-user --namespace user"${user}" admin user"${user}"
done
#+end_src #+end_src

View File

@ -10,7 +10,7 @@ summary: "In this first exercise we'll get familiar with OpenShift."
Red Hat [OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) is a unified platform to build, modernize, and deploy applications at scale. In this first excercise we'll get logged into our cluster and familarise ourselves with the OpenShift web console and web terminal. Red Hat [OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) is a unified platform to build, modernize, and deploy applications at scale. In this first excercise we'll get logged into our cluster and familarise ourselves with the OpenShift web console and web terminal.
The OpenShift Container Platform web console is a feature-rich web console with both an Administrator perspective and a Developer perspective accessible through any modern web browser. You can use the web console to visualize, browse, and manage your OpenShift cluster and the applications running on it. The OpenShift Container Platform web console is a feature-rich user interface with both an **Administrator** perspective and a **Developer** perspective accessible through any modern web browser. You can use the web console to visualize, browse, and manage your OpenShift cluster and the applications running on it.
In addition to the web console, OpenShift includes command line tools to provide users with a nice interface to work with applications deployed to the platform. The `oc` command line tool is available for Linux, macOS or Windows. In addition to the web console, OpenShift includes command line tools to provide users with a nice interface to work with applications deployed to the platform. The `oc` command line tool is available for Linux, macOS or Windows.
@ -18,7 +18,7 @@ In addition to the web console, OpenShift includes command line tools to provide
## 1.1 - Login to lab environment ## 1.1 - Login to lab environment
An OpenShift `4.14` cluster has already been provisioned for you to complete these excercises. Open your web browser and navigate to the workshop login page https://demo.redhat.com/workshop/vq5abz. An OpenShift `4.14` cluster has already been provisioned for you to complete these excercises. Open your web browser and navigate to the workshop login page https://demo.redhat.com/workshop/enwmgc.
Once the page loads you can login with the details provided by your workshop facilitator. Once the page loads you can login with the details provided by your workshop facilitator.
@ -50,7 +50,7 @@ Each project has its own resources, role based access control (who can or cannot
Projects act as a "wrapper" around all the application services you (or your teams) are using for your work. Projects act as a "wrapper" around all the application services you (or your teams) are using for your work.
In this lab environment, you already have access to single project: `userX` (Where X is the number of your user allocted for the workshop.) In this lab environment, you already have access to single project: `userX` (Where X is the number of your user allocted for the workshop from the previous step.)
Let's click into our `Project` from the left hand panel of the **Developer** web console perspective. We should be able to see that our project has no `Deployments` and there are no compute cpu or memory resources currently being consumed. Let's click into our `Project` from the left hand panel of the **Developer** web console perspective. We should be able to see that our project has no `Deployments` and there are no compute cpu or memory resources currently being consumed.
@ -188,3 +188,4 @@ That's a quick introduction to the `oc` command line utility. Let's close our we
| *Closing your web terminal* | | *Closing your web terminal* |
</Zoom> </Zoom>
Well done, you've finished exercise 1! 🎉

View File

@ -128,3 +128,4 @@ How much cpu and memory is your ParksMap application currently using?
| *Checking the ParksMap application resource usage* | | *Checking the ParksMap application resource usage* |
</Zoom> </Zoom>
Well done, you've finished exercise 2! 🎉

View File

@ -113,3 +113,10 @@ pod "parksmap-ff7477dc4-2nxd2" deleted
If we now run `oc get pods` again we will see a new **Pod** has automatically been created by OpenShift to replace the one we fully deleted. This is because OpenShift is a container orchestration engine that will always try and enforce the desired state that we declare. If we now run `oc get pods` again we will see a new **Pod** has automatically been created by OpenShift to replace the one we fully deleted. This is because OpenShift is a container orchestration engine that will always try and enforce the desired state that we declare.
In our ParksMap **Deployment** we have declared we always want two replicas of our application running at all times. Even if we (possibly accidentally) delete one, OpenShift will always attempt to self heal to return to our desired state. In our ParksMap **Deployment** we have declared we always want two replicas of our application running at all times. Even if we (possibly accidentally) delete one, OpenShift will always attempt to self heal to return to our desired state.
## 3.5 - Bonus objective: Autoscaling
If you have time, take a while to explore the concepts of [HorizontalPodAutoscaling](https://docs.openshift.com/container-platform/4.14/nodes/pods/nodes-pods-autoscaling.html), [VerticalPodAutoscaling](https://docs.openshift.com/container-platform/4.14/nodes/pods/nodes-pods-vertical-autoscaler.html) and [Cluster autoscaling](https://docs.openshift.com/container-platform/4.14/machine_management/applying-autoscaling.html).
Well done, you've finished exercise 3! 🎉

View File

@ -2,7 +2,7 @@
title: Deploying an application via helm chart title: Deploying an application via helm chart
exercise: 4 exercise: 4
date: '2023-12-06' date: '2023-12-06'
tags: ['openshift','containers','kubernetes','deployments','autoscaling'] tags: ['openshift','containers','kubernetes','deployments','helm']
draft: false draft: false
authors: ['default'] authors: ['default']
summary: "Exploring alternative deployment approaches." summary: "Exploring alternative deployment approaches."
@ -34,7 +34,7 @@ In the YAML configuration window enter the following, substituting `userX` with
```yaml ```yaml
db: db:
password: userX password: userX
hostname: userX-gitea.apps.<clusterdomain> hostname: userX-gitea.apps.cluster-dsmsm.dynamic.opentlc.com
tlsRoute: true tlsRoute: true
``` ```
@ -131,3 +131,10 @@ Enter the `gitea` confirmation at the prompt and click **Delete**. If you now re
| *Deleting the gitea application helm release* | | *Deleting the gitea application helm release* |
</Zoom> </Zoom>
## 4.6 - Bonus objective: Artifact Hub
If you have time, take a while to explore https://artifacthub.io/packages/search to see the kinds of applications available in the most popular publicly available Helm Chart repository Artifact Hub.
Well done, you've finished exercise 4! 🎉

View File

@ -47,7 +47,7 @@ spec:
Click the **+** button in the top right corner menu bar of the OpenShift web console. This is a fast way to quickly import snippets of YAML for testing or exploration purposes. Click the **+** button in the top right corner menu bar of the OpenShift web console. This is a fast way to quickly import snippets of YAML for testing or exploration purposes.
Paste the above snippet of YAML into the editor and replace the three instances of `userX` with your assigned user. Paste the above snippet of YAML into the editor and replace the instance of `userX` with your assigned user.
Click **Create**. In a minute or so you should see the Grafana operator installed and running in your project. Click **Create**. In a minute or so you should see the Grafana operator installed and running in your project.
@ -96,7 +96,7 @@ spec:
spec: spec:
tls: tls:
termination: edge termination: edge
host: grafana-userX.apps.cluster-4dq8d.dynamic.opentlc.com host: grafana-userX.apps.cluster-dsmsm.dynamic.opentlc.com
``` ```
<Zoom> <Zoom>
@ -136,4 +136,9 @@ Once the new tab opens we should be able to login to Grafana using the credentia
</Zoom> </Zoom>
## 5.4 - Bonus objective: Grafana dashboards
If you have time, take a while to learn about the https://grafana.com/grafana/dashboards and how Grafana can be used to visualise just about anything.
Well done, you've finished exercise 5! 🎉

View File

@ -88,3 +88,11 @@ After the build has completed and successfully:
- The ReplicaSet will detect no Pods are running and will cause one to be deployed, as our default replica count is just 1. - The ReplicaSet will detect no Pods are running and will cause one to be deployed, as our default replica count is just 1.
To conclude, when issuing the `oc get pods` command, you will see that the build **Pod** has finished (exited) and that an application **Pod** is in a ready and running state. To conclude, when issuing the `oc get pods` command, you will see that the build **Pod** has finished (exited) and that an application **Pod** is in a ready and running state.
## 6.3 - Bonus objective: Podman
If you have time, take a while to understand how [Podman](https://developers.redhat.com/articles/2022/05/02/podman-basics-resources-beginners-and-experts) can be used to build container images on your device outside of an OpenShift cluster.
Well done, you've finished exercise 6! 🎉

View File

@ -47,7 +47,7 @@
<description>Exploring alternative deployment approaches.</description> <description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate> <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author> <author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item> </item>
<item> <item>

View File

@ -20,15 +20,5 @@
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category>
</item> </item>
<item>
<guid>https://jmhbnz.github.io/ocp-app-delivery-workshop/workshop/exercise4</guid>
<title>Deploying an application via helm chart</title>
<link>https://jmhbnz.github.io/ocp-app-delivery-workshop/workshop/exercise4</link>
<description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category>
</item>
</channel> </channel>
</rss> </rss>

View File

@ -47,7 +47,7 @@
<description>Exploring alternative deployment approaches.</description> <description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate> <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author> <author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item> </item>
<item> <item>

View File

@ -37,7 +37,7 @@
<description>Exploring alternative deployment approaches.</description> <description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate> <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author> <author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item> </item>
</channel> </channel>

24
public/tags/helm/feed.xml Normal file
View File

@ -0,0 +1,24 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Red Hat OpenShift Application Delivery Workshop</title>
<link>https://jmhbnz.github.io/ocp-app-delivery-workshop/workshop</link>
<description>Red Hat OpenShift Application Delivery Workshop</description>
<language>en-us</language>
<managingEditor>jablair@redhat.com (Red Hat)</managingEditor>
<webMaster>jablair@redhat.com (Red Hat)</webMaster>
<lastBuildDate>Wed, 06 Dec 2023 00:00:00 GMT</lastBuildDate>
<atom:link href="https://jmhbnz.github.io/ocp-app-delivery-workshop/tags/helm/feed.xml" rel="self" type="application/rss+xml"/>
<item>
<guid>https://jmhbnz.github.io/ocp-app-delivery-workshop/workshop/exercise4</guid>
<title>Deploying an application via helm chart</title>
<link>https://jmhbnz.github.io/ocp-app-delivery-workshop/workshop/exercise4</link>
<description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item>
</channel>
</rss>

View File

@ -47,7 +47,7 @@
<description>Exploring alternative deployment approaches.</description> <description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate> <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author> <author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item> </item>
<item> <item>

View File

@ -47,7 +47,7 @@
<description>Exploring alternative deployment approaches.</description> <description>Exploring alternative deployment approaches.</description>
<pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate> <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author> <author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>autoscaling</category> <category>openshift</category><category>containers</category><category>kubernetes</category><category>deployments</category><category>helm</category>
</item> </item>
<item> <item>