Begin working on exercise 7.

This commit is contained in:
2024-07-25 18:47:23 +12:00
parent c65aa7803a
commit ca517645fe
8 changed files with 78 additions and 8 deletions

View File

@ -7,11 +7,11 @@ This repository contains a basic [[https://nextjs.org/][nextjs]] frontend design
The frontend is used to serve workshop instructions for several workshops.
** Setting up a cluster for the workshop
* Setting up a cluster for the workshop
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
Required so the Gitea helm chart will be available for all users.
@ -29,7 +29,7 @@ EOF
#+end_src
*** Install web terminal operator
** Install web terminal operator
So our workshop participants don't need to install ~oc~ locally.
@ -50,7 +50,7 @@ EOF
#+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.
@ -73,3 +73,34 @@ for user in $(seq 1 30); do
oc adm policy add-role-to-user --namespace user"${user}" admin user"${user}"
done
#+end_src
** Install openshift gitops operator
Each user will deploy their own argocd instance so we need to install the openshift gitops operator for all namespaces.
#+begin_src bash
cat << EOF | oc apply --filename -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
channel: latest
installPlanApproval: Automatic
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
startingCSV: openshift-gitops-operator.v1.13.0
EOF
#+end_src
** Scale cluster worker nodes
We are going to have ~25 workshop attendees all deploying applications, let's ensure the cluster has enough capacity to handle it!
#+begin_src bash
oc scale machineset cluster-xxz98-mk8x7-worker-ap-southeast-1b -n openshift-machine-api --replicas 10
#+end_src

View File

@ -179,4 +179,4 @@ That's a quick introduction to the `oc` command line utility. Let's close our we
| *Closing your web terminal* |
</Zoom>
Well done, you've finished exercise 1! 🎉
Well done, you're now ready to move on to Exercise 2 and deploy an application! 🎉

View File

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

View File

@ -130,4 +130,4 @@ Enter the `gitea` confirmation at the prompt and click **Delete**. If you now re
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! 🎉
You've finished exercise 4, time to deploy an application with an Operator! 🎉

View File

@ -91,4 +91,4 @@ To conclude, when issuing the `oc get pods` command, you will see that the build
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! 🎉
Awesome you've finished exercise 6! 🎉

View File

@ -0,0 +1,29 @@
---
title: Optional - Deploying an application via gitops
exercise: 7
date: '2024-07-25'
tags: ['openshift','containers','kubernetes','argocd','gitops']
draft: false
authors: ['default']
summary: "Keen to explore a more advanced deployment pattern?"
---
Now that you've had a taste of most of the more basic deployment methods let's introduce the concept of [GitOps](https://www.redhat.com/en/topics/devops/what-is-gitops) and deploy an application using this more advanced approach.
In simple terms GitOps uses Git repositories as a single source of truth to deliver applications or infrastructure as code. Whenever you merge or push code into a specifc Git branch in a repository, an GitOps continuous delivery tool such as [ArgoCD](https://argo-cd.readthedocs.io/en/stable) can then automatically sync that to one or more Kubernetes clusters.
<Zoom>
|![argocd](/static/images/argocd-ui.gif) |
|:-------------------------------------------------------------------:|
| *ArgoCD user interface* |
</Zoom>
For many organisations GitOps is a goal deployment methodology as application definitions, configurations, and environments should ideally be declarative and version controlled. Application deployment and lifecycle management should be automated, auditable, and easy to understand.
Since 2021 OpenShift has included a fully supported [OpenShift GitOps](https://www.redhat.com/en/blog/announcing-openshift-gitops) operator, based on the upstream ArgoCD project.
This operator has already been installed on your cluster so let's take it for a spin now! 🚀
## 7.1 - Log in to openshift gitops web interface

View File

@ -70,5 +70,15 @@
<category>openshift</category><category>containers</category><category>kubernetes</category><category>s2i</category><category>shipwright</category>
</item>
<item>
<guid>https://rhdemo.win/workshop/exercise7</guid>
<title>Optional - Deploying an application via gitops</title>
<link>https://rhdemo.win/workshop/exercise7</link>
<description>Keen to explore a more advanced deployment pattern?</description>
<pubDate>Thu, 25 Jul 2024 00:00:00 GMT</pubDate>
<author>jablair@redhat.com (Red Hat)</author>
<category>openshift</category><category>containers</category><category>kubernetes</category><category>argocd</category><category>gitops</category>
</item>
</channel>
</rss>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB