Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ outputFormats:
mediatype: application/json

menus:
main:
- name: Workshop
url: https://play.validatedpatterns.io
weight: 25
main: []
sitemap:
changeFreq: monthly
priority: 0.5
Expand Down
23 changes: 23 additions & 0 deletions content/workshop/_index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Validated Patterns Workshop"
menu:
main:
weight: 25
name: Workshop
---

= Welcome to the Validated Patterns Workshop!

== Overview

**Reference Architectures with Added Value**

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.

== About the Validated Patterns Workshop

The goal of this workshop is to immerse the participant in foundational knowledge for creating, using and extending a GitOps pattern with the Validated Patterns framework. In this workshop participants will:

- Learn GitOps fundamentals
- Deploy a Validated Pattern
- Extend an existing Validated Pattern
9 changes: 9 additions & 0 deletions content/workshop/additional-resources.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
menu: workshop
title: Additional Resources
weight: 100
---

include::modules/comm-attributes.adoc[]

= Appendix - Additional Resources
40 changes: 40 additions & 0 deletions content/workshop/cluster-domains.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
menu:
workshop:
parent: Additional Resources
title: Cluster Domains
weight: 102
---

:toc:
include::modules/comm-attributes.adoc[]

[#limitations]
== Limitations

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

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

[#variables]
== Domain variables set by the pattern

|===
|**Variable**|**Purpose**|**Example (if applicable)**
| `global.clusterDomain`
| Domain of the cluster the application is running on without the `.apps` subdomain
|`mcg-hub.aws.validatedpatterns.io`
|`global.hubClusterDomain`
| The domain of the hub cluster **with the apps** subdomain - same as `localClusterDomain` on the hub.
| `apps.mcg-hub.aws.validatedpatterns.io`
| `global.localClusterDomain`
| The domain of the cluster the application is running on - **with the apps** subdomain
| `apps.mcg-hub.aws.validatedpatterns.io`
| `global.clusterPlatform`
| Name of the platform
| `aws`, `azure`, `gcp`
| `global.clusterVersion`
| OpenShift Cluster Version
| `4.16`

|===
120 changes: 120 additions & 0 deletions content/workshop/consuming-patterns.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
menu: workshop
title: Validated Patterns
weight: 50
---

:toc:
include::modules/comm-attributes.adoc[]
:imagesdir: /images/workshop

== Consuming Validated Patterns
[#workflow]

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.

image::consuming-vpWorkflow-hub.png[Hub Cluster]

1. The patterns operator deploys an instance of {rh-gitops} and creates the initial application
2. ArgoCD then deploys the operators, namespaces, projects and applications defined in the values files
3. If deploying across multiple clusters, the framework uses {rhacm} policies to create the instance of {rh-gitops} on the remote cluster

NOTE: `values-hub.yaml` is the primary values file for the `hub` cluster

image::consuming-vpWorkflow-managedCluster.png[Managed Cluster]

1. When a managed cluster is joined to {rhacm} it needs to have a clusterGroup label applied to it for the correct policies and applications to be deployed.
2. {rhacm} will confirm the cluster is managed then deploy a rhacm agent
3. A placement policy is then deployed to the managed cluster which installs an instances of {rh-gitops}
4. The managed cluster's instance of ArgoCD will then deploy the resources declared in `values-clustergroup.yaml`

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

== Element Layering
[#layering]

Architecturally, Patterns share a very similar base structure, as seen below.

image::consuming-common.png[common]

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.

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

What if we wanted to swap these products out with a similar or like-in-kind solution? The workflow remains the same:

- remove the undesired application declaration
- declare the new application in your values file
- declare where the helm charts reside (path, repo)

The following graphic illustrates swapping components in the framework:

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

== The Base Architecture
[#skeleton]

So where exactly are these different architectural components defined?

=== GitOps

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.

Check out an example Pattern CR for an {mcg-pattern} installation:

[source,yaml]
----
apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1
kind: Pattern
metadata:
name: multicloud-gitops
namespace: openshift-operators
spec:
clusterGroupName: hub
gitSpec:
targetRepo: https://github.com/validatedpatterns/multicloud-gitops.git
targetRevision: main
----

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.

=== Secrets Management

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].

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.

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.

=== ACM

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.

[source,yaml]
----
clusterGroup:
managedClusterGroups:
exampleRegion:
name: group-one
acmlabels:
- name: clusterGroup
value: group-one
----

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].

=== Imperative Jobs

The example imperative job in the {mcg-pattern} is

[source,yaml]
----
clusterGroup:
imperative:
jobs:
- name: hello-world
playbook: rhvp.cluster_utils.hello_world
timeout: 234
----

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.
Loading