Skip to content

Commit 81bee59

Browse files
committed
update workshop content to remove common and be more modern
1 parent 4d28a47 commit 81bee59

38 files changed

Lines changed: 334 additions & 422 deletions

content/workshop/_index.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ menu:
66
name: Workshop
77
---
88

9+
= Welcome to the Validated Patterns Workshop!
10+
11+
== Overview
12+
913
**Reference Architectures with Added Value**
1014

1115
Validated Patterns are an evolution of how you deploy and manage applications in a hybrid cloud. With a pattern, you can automatically deploy a full application stack through a GitOps-based framework. With this framework, you can create business-centric solutions while maintaining a level of Continuous Integration (CI) over your application.

content/workshop/cluster-domains.adoc

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,15 @@ weight: 102
99
:toc:
1010
include::modules/comm-attributes.adoc[]
1111

12-
= Cluster Domains
13-
14-
== Topic Objectives
15-
16-
[#objectives]
17-
In this topic we will discuss:
18-
19-
* ArgoCD Limitations
20-
* How the framework collects and uses cluster information
21-
2212
[#limitations]
23-
=== Limitations
13+
== Limitations
2414

2515
By default ArgoCD does not expose any means to know the cluster's name/FQDN (Fully Qualified Domain Name)
2616

2717
To make up for this the framework collects some cluster information in order to provide reusable parameters for cluster specific values.
2818

2919
[#variables]
30-
=== Domain variables set by the pattern
20+
== Domain variables set by the pattern
3121

3222
|===
3323
|**Variable**|**Purpose**|**Example (if applicable)**

content/workshop/consuming-patterns.adoc

Lines changed: 69 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,7 @@ weight: 50
88
include::modules/comm-attributes.adoc[]
99
:imagesdir: /images/workshop
1010

11-
= Consuming Validated Patterns
12-
13-
== Topic Objectives
14-
15-
[#objectives]
16-
In this topic we will discuss:
17-
18-
* Validated Pattern Deployment workflow
19-
* Describing a pattern
20-
* Using the patterns operator
21-
** And the patterns.sh script
22-
* Preparing your environment
23-
* Understand our base pattern
24-
* To fork or not to fork
25-
26-
== Validated Pattern workflow
11+
== Consuming Validated Patterns
2712
[#workflow]
2813

2914
Let's dive into what happens when we deploy a pattern! Take a look at the following graphic to see what is deployed on the `hub` clusterGroup cluster.
@@ -45,16 +30,14 @@ image::consuming-vpWorkflow-managedCluster.png[Managed Cluster]
4530

4631
IMPORTANT: Deploying the pattern through the OpenShift Console or via `pattern.sh` will deploy the patterns operator.
4732

48-
=== Element Layering
33+
== Element Layering
4934
[#layering]
5035

51-
The base component of every Validated Pattern is `common` - which is a link:https://github.com/validatedpatterns/common[Github Repo]
36+
Architecturally, Patterns share a very similar base structure, as seen below.
5237

5338
image::consuming-common.png[common]
5439

55-
Without further configuration, common is actually quite boring. So let's add another layer!
56-
57-
Your specific industry or use-case is layered into the framework and utilizes the underlying common. In this example the solution includes a bespoke application, cloud-native cluster storage, {rhacs}, and an enterprise container registry. The framework will deploy and configure these components through Helm charts, kustomize manifests or Ansible if necessary.
40+
Your specific industry or use-case is layered into the framework and utilizes the underlying base structure. In this example, the solution includes a bespoke application, cloud-native cluster storage, {rhacs}, and an enterprise container registry. The framework will deploy and configure these components through Helm charts, Kustomize manifests or Ansible if necessary.
5841

5942
image::consuming-common-solution-layering.png[]
6043

@@ -68,9 +51,70 @@ The following graphic illustrates swapping components in the framework:
6851

6952
image::consuming-common-solution-layering-modular.png[]
7053

71-
[#multiArgos]
72-
== Multiple ArgoCDs
54+
== The Base Architecture
55+
[#skeleton]
56+
57+
So where exactly are these different architectural components defined?
58+
59+
=== GitOps
60+
61+
link:https://github.com/validatedpatterns/patterns-operator[The {validated-patterns-op}] automatically deploys an instance of {rh-gitops-short} when a Pattern CR is installed on the cluster.
62+
63+
Check out an example Pattern CR for an {mcg-pattern} installation:
64+
65+
[source,yaml]
66+
----
67+
apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1
68+
kind: Pattern
69+
metadata:
70+
name: multicloud-gitops
71+
namespace: openshift-operators
72+
spec:
73+
clusterGroupName: hub
74+
gitSpec:
75+
targetRepo: https://github.com/validatedpatterns/multicloud-gitops.git
76+
targetRevision: main
77+
----
78+
79+
When the {validated-patterns-op} reconciles this CR, it creates an Argo Application using link:https://github.com/validatedpatterns/clustergroup-chart[the Validated Patterns Clustergroup Chart] and link:https://github.com/validatedpatterns/multicloud-gitops/blob/main/values-hub.yaml[the values-`<.spec.clusterGroupName>`.yaml values] from the CR above.
80+
81+
=== Secrets Management
82+
83+
The default secrets backend uses link:https://charts.validatedpatterns.io/charts/hashicorp-vault[Vault] and link:https://charts.validatedpatterns.io/charts/openshift-external-secrets[ESO].
84+
85+
As you can see in our link:https://github.com/validatedpatterns/multicloud-gitops/blob/main/values-hub.yaml[values-hub.yaml], we provide a namespace, subscription and an application for both of these components.
86+
87+
When we run `./pattern.sh make install` it ultimately calls link:https://github.com/validatedpatterns/rhvp.cluster_utils/blob/main/playbooks/load_secrets.yml[the rhvp.cluster_utils.load_secrets playbook] and loads a secrets file from our home directory into Vault as part of the pattern installation process.
88+
89+
=== ACM
90+
91+
Similar to the secrets management, link:https://charts.validatedpatterns.io/charts/acm[ACM] is provided in `values-hub.yaml` as a namespace, subscription and an application. By providing a `managedClusterGroups` block in our `values-hub.yaml` we are able to provision spoke clusters with the Validated Patterns framework as well.
92+
93+
[source,yaml]
94+
----
95+
clusterGroup:
96+
managedClusterGroups:
97+
exampleRegion:
98+
name: group-one
99+
acmlabels:
100+
- name: clusterGroup
101+
value: group-one
102+
----
103+
104+
Any cluster that ACM sees labeled with `clusterGroup=group-one` will be provisioned with our link:https://github.com/validatedpatterns/clustergroup-chart[Clustergroup chart] and linkhttps://github.com/validatedpatterns/multicloud-gitops/blob/main/values-group-one.yaml[values-group-one.yaml].
105+
106+
=== Imperative Jobs
107+
108+
The example imperative job in the {mcg-pattern} is
73109

74-
You may be asking yourself ...
110+
[source,yaml]
111+
----
112+
clusterGroup:
113+
imperative:
114+
jobs:
115+
- name: hello-world
116+
playbook: rhvp.cluster_utils.hello_world
117+
timeout: 234
118+
----
75119

76-
image::consuming-multipleArgos.png[]
120+
This gets transformed by link:https://github.com/validatedpatterns/clustergroup-chart/tree/main/templates/imperative[the Clustergroup chart] into several resources. This process is a bit complex and we will cover it in more detail later.

content/workshop/creating-patterns.adoc

Lines changed: 96 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -10,87 +10,14 @@ weight: 52
1010
include::modules/comm-attributes.adoc[]
1111
:imagesdir: /images/workshop
1212

13-
= Creating Validated Patterns
14-
15-
== Topic Objectives
16-
17-
[#objectives]
18-
In this topic we will discuss:
19-
20-
* Understanding `common`
21-
* Pattern Requirements
22-
* Creation Process
23-
2413
[IMPORTANT]
2514
.Core Concepts
2615
====
27-
* **Creating is Extending** We never really create a new pattern from zero. Instead we extend our basic pattern using artifacts that we have developed along the way
2816
* **Artifacts** Artifacts can include Helm Charts, Kustomize manifests, or plain Kubernetes manifests
2917
* **Moving Artifacts into the Validated Patterns framework** Many artifacts require conversion to Helm chart templates and parameterizing certain values
3018
* **Helm** Helm is a kubernetes package manager that allows you to define, install and manage kubernetes applications as reusable packages called charts
3119
====
3220

33-
[#common]
34-
== Understanding common
35-
36-
What's the role of the **common** repository?
37-
38-
* The core components that make up the Validated Patterns framework are contained in the common repository
39-
* Including:
40-
** OpenShift GitOps configurations
41-
** RHACM configuration and Global Policies
42-
*** Support for **clusterGroup** and **GitOps** policies
43-
** Validated Pattern build scripts and Makefiles
44-
** Secrets Management (Hashicorp Vault)
45-
** Operator CRDs and other assets
46-
** Various utility scripts
47-
48-
What's in common?
49-
50-
NOTE: The common repository is where all the common manifests for the Validated Patterns framework live
51-
52-
* **acm** - contains the helm charts, which contains policies and is used to configure the deployment of the {rhacm}
53-
* **clusterGroup** - contains the helm charts used to create namespaces, subscriptions, Argo Project and Applications described in values files. This is the seed for all the patterns.
54-
* **operator-install** - contains the helm chart used by the Validated Patterns operator to create the openshift-gitops component, creating the initial ArgoCD applications for Validated Patterns.
55-
56-
[source,bash]
57-
----
58-
common
59-
├── acm
60-
├── ansible
61-
├── Changes.md
62-
├── clustergroup
63-
├── common -> .
64-
├── examples
65-
├── golang-external-secrets
66-
├── hashicorp-vault
67-
├── LICENSE
68-
├── Makefile
69-
├── letsencrypt
70-
├── operator-install
71-
├── README.md
72-
├── reference-output.yaml
73-
├── scripts
74-
├── super-linter.log
75-
├── tests
76-
└── values-global.yaml
77-
----
78-
79-
* **ansible** - this directory contains the ansible roles and modules that support the secrets management for a pattern
80-
* **hashicorp-vault** - contains the helm chart for {vault}
81-
* **scripts** - contains utility scripts used by the Validated Patterns Framework
82-
* **golang-external-secrets** - Helm chart for the {eso}
83-
84-
=== What's next for common?
85-
86-
* We are in the very early stages of moving the helm charts in common into a public Helm repository
87-
* Deploying our patterns with multi-source enabled which allows us to use multiple sources for values, which will help reduce the need to have all the charts in the repo
88-
* Continue to maintain Makefiles, Ansible scripts and other tools in this repo in support of deploying patterns
89-
90-
You may be wondering - **why**?
91-
92-
We want to maximize modularity in the framework. This will reduce our reliance on the common repository as it is today and will decrease the footprint and complexity of the patterns.
93-
9421
[#creation]
9522
== Creation Process
9623

@@ -272,3 +199,99 @@ They should be viewed as absolutely hard coded into the pattern.
272199
- name: ocp_auth.bind_password
273200
value: "supersecret"
274201
----
202+
203+
== Using Patternizer to create new patterns
204+
205+
When creating new patterns you have two options: you can either fork an existing pattern and modify it to suit your purpose or start a new pattern from scratch.
206+
207+
link:https://github.com/validatedpatterns/patternizer[The patternizer tool] exists to expedite starting a pattern from scratch.
208+
209+
To create a new pattern you merely need to run `podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" quay.io/validatedpatterns/patternizer init --with-secrets` (you can omit the `--with-secrets` if you don't need to use the secrets framework.)
210+
211+
On an empty directory, named `workshop-pattern`, this currently produces the following files:
212+
213+
[source,bash]
214+
----
215+
workshop-pattern
216+
├── ansible.cfg # the default ansible configuration
217+
├── Makefile # a stub Makefile which includes Makefile-common
218+
├── Makefile-common # where all the common commands (install, load-secrets, etc) live
219+
├── pattern.sh # the convenvience utility container (has oc, helm, makefile, etc)
220+
├── values-global.yaml # names the pattern based on the directory and sets common defaults
221+
├── values-prod.yaml # contains the components for using the secrets framework
222+
└── values-secret.yaml.template # a stub for the secrets file
223+
----
224+
225+
The `values-global.yaml` contains
226+
227+
[source,yaml]
228+
----
229+
global:
230+
pattern: workshop-pattern
231+
singleArgoCD: true
232+
secretLoader:
233+
disabled: false
234+
main:
235+
clusterGroupName: prod
236+
multiSourceConfig:
237+
enabled: true
238+
clusterGroupChartVersion: 0.9.*
239+
----
240+
241+
and the `values-prod.yaml` contains
242+
243+
[source,yaml]
244+
----
245+
clusterGroup:
246+
name: prod
247+
namespaces:
248+
- workshop-pattern
249+
- vault
250+
- external-secrets-operator:
251+
operatorGroup: true
252+
targetNamespaces: []
253+
- external-secrets
254+
subscriptions:
255+
eso:
256+
name: openshift-external-secrets-operator
257+
namespace: external-secrets-operator
258+
channel: stable-v1
259+
applications:
260+
openshift-external-secrets:
261+
name: openshift-external-secrets
262+
namespace: external-secrets
263+
chart: openshift-external-secrets
264+
chartVersion: 0.0.*
265+
vault:
266+
name: vault
267+
namespace: vault
268+
chart: hashicorp-vault
269+
chartVersion: 0.1.*
270+
----
271+
272+
[TIP]
273+
.Shell Function
274+
====
275+
You can add a simple shell function to your shell config file (ex `~/.zshrc`) to enable easier use of the tool.
276+
277+
[source,bash]
278+
----
279+
pattern() {
280+
podman run --pull=newer \
281+
-v "$PWD:$PWD:z" \
282+
-w "$PWD" \
283+
quay.io/validatedpatterns/patternizer "$@"
284+
}
285+
----
286+
287+
Now you can more simply run `pattern init`.
288+
====
289+
290+
[NOTE]
291+
.Idempotency
292+
====
293+
The `pattern init` command is idempotent and can be used several times during pattern creation to update the patterns values files.
294+
You can go from just using `pattern init` to `pattern init --with-secrets` to add the secret framework to your pattern.
295+
If you use `helm create` (or `./pattern.sh helm create`) to create helm charts and then run `pattern init` again, the helm charts
296+
will be automatically added to your `values-prod.yaml`.
297+
====

content/workshop/demo.adoc

Lines changed: 0 additions & 14 deletions
This file was deleted.

content/workshop/demo.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
menu:
3+
workshop:
4+
parent: Introduction
5+
title: Demo
6+
weight: 21
7+
---
8+
9+
# Validated Patterns Workshop Demo
10+
11+
This interactive demo walks through installing the Validated Patterns operator and deploying the [Multicloud Gitops](/patterns/multicloud-gitops/) pattern on a fresh OpenShift cluster using the Validated Patterns Catalog.
12+
13+
{{< arcade url="https://demo.arcade.software/share/m8RRb4Wanooo2Vq6iV5O" title="Validated Patterns Workshop Demo" >}}

content/workshop/eso-and-vault.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ weight: 61
1010
include::modules/comm-attributes.adoc[]
1111
:imagesdir: /images/workshop
1212

13-
= Secrets Management in Validated Patterns
14-
1513
[#esoVault]
1614
== ESO and Vault
1715

0 commit comments

Comments
 (0)