Skip to content

Commit a24c184

Browse files
committed
add creating a pattern with patternizer page to learn section of site
1 parent 2a86ac1 commit a24c184

5 files changed

Lines changed: 189 additions & 27 deletions

File tree

content/contribute/creating-a-pattern.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ Therefore the question really is: How do I move my successful architecture solut
3232

3333
== Requirements for creating a new pattern
3434

35-
* The patterns framework requires some artifacts like OpenShift GitOps (ArgoCD) in order to provide the GitOps automation. All existing patterns use OpenShift GitOps as a starting point. The link:/patterns/multicloud-gitops[multicloud-gitops pattern] is the most fundamental of patterns and therefore it is recommended to use it as a base pattern. I.e Create a new pattern based on it.
35+
* The recommended way to create a new pattern is to use link:/learn/creating-patterns-with-patternizer/[patternizer], which generates all required scaffolding automatically. Alternatively, fork the link:/patterns/multicloud-gitops[multicloud-gitops pattern] as a starting point.
36+
* The patterns framework requires OpenShift GitOps (ArgoCD) to provide the GitOps automation. Patternizer sets this up for you; if starting from a fork, ensure OpenShift GitOps is included.
3637
* Create a new branch on your new pattern to perform the initial changes.
37-
* Deploy the initial new pattern pattern to the cluster.
38+
* Deploy the initial new pattern to the cluster.
3839

3940
== Moving to the validated patterns framework
4041

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
menu:
3+
learn:
4+
parent: Patterns quick start
5+
title: Creating a pattern with patternizer
6+
weight: 19
7+
---
8+
9+
:toc:
10+
:imagesdir: /images
11+
:_content-type: ASSEMBLY
12+
include::modules/comm-attributes.adoc[]
13+
14+
== Creating a new pattern with patternizer
15+
16+
link:https://github.com/validatedpatterns/patternizer[Patternizer] is a command-line tool that bootstraps a Git repository into a ready-to-use Validated Pattern. It generates all required scaffolding -- values files, Makefile, `pattern.sh`, and Ansible configuration -- so you can focus on defining your applications rather than wiring up framework boilerplate.
17+
18+
=== Prerequisites
19+
20+
* A container runtime (Podman or Docker)
21+
* Git
22+
23+
[TIP]
24+
.Shell Function
25+
====
26+
You can add a simple shell function to your shell configuration file (for example `~/.zshrc` or `~/.bashrc`) to enable easier use of the tool.
27+
28+
[source,bash]
29+
----
30+
pattern() {
31+
podman run --pull=newer \
32+
-v "$PWD:$PWD:z" \
33+
-w "$PWD" \
34+
quay.io/validatedpatterns/patternizer "$@"
35+
}
36+
----
37+
38+
With this function, you can run `pattern init` directly instead of the full `podman run` command. The examples below assume this function is in place.
39+
====
40+
41+
=== Step 1: Create your pattern repository
42+
43+
Create or clone an empty Git repository named after your pattern. The directory name becomes the pattern name in `values-global.yaml`.
44+
45+
[source,terminal]
46+
----
47+
$ mkdir my-pattern && cd my-pattern
48+
$ git init
49+
----
50+
51+
=== Step 2: Initialize the pattern
52+
53+
To create a pattern without the secrets framework:
54+
55+
[source,terminal]
56+
----
57+
$ pattern init
58+
----
59+
60+
To create a pattern with HashiCorp Vault and External Secrets Operator scaffolding:
61+
62+
[source,terminal]
63+
----
64+
$ pattern init --with-secrets
65+
----
66+
67+
==== What patternizer generates
68+
69+
Running `pattern init --with-secrets` on an empty directory named `my-pattern` produces the following files:
70+
71+
[source,bash]
72+
----
73+
my-pattern
74+
├── ansible.cfg # default Ansible configuration
75+
├── Makefile # stub Makefile which includes Makefile-common
76+
├── Makefile-common # common commands (install, load-secrets, etc.)
77+
├── pattern.sh # convenience utility container (has oc, helm, make, etc.)
78+
├── values-global.yaml # names the pattern based on the directory and sets common defaults
79+
├── values-prod.yaml # contains the components for the secrets framework
80+
└── values-secret.yaml.template # stub for the secrets file
81+
----
82+
83+
The generated `values-global.yaml` contains:
84+
85+
[source,yaml]
86+
----
87+
global:
88+
pattern: my-pattern
89+
singleArgoCD: true
90+
secretLoader:
91+
disabled: false
92+
main:
93+
clusterGroupName: prod
94+
multiSourceConfig:
95+
enabled: true
96+
clusterGroupChartVersion: 0.9.*
97+
----
98+
99+
The generated `values-prod.yaml` contains:
100+
101+
[source,yaml]
102+
----
103+
clusterGroup:
104+
name: prod
105+
namespaces:
106+
my-pattern:
107+
vault:
108+
external-secrets-operator:
109+
operatorGroup: true
110+
targetNamespaces: []
111+
external-secrets:
112+
subscriptions:
113+
eso:
114+
name: openshift-external-secrets-operator
115+
namespace: external-secrets-operator
116+
channel: stable-v1
117+
applications:
118+
openshift-external-secrets:
119+
name: openshift-external-secrets
120+
namespace: external-secrets
121+
chart: openshift-external-secrets
122+
chartVersion: 0.0.*
123+
vault:
124+
name: vault
125+
namespace: vault
126+
chart: hashicorp-vault
127+
chartVersion: 0.1.*
128+
----
129+
130+
If you omit `--with-secrets`, the generated files will not include the Vault and External Secrets Operator configuration, and `secretLoader.disabled` will be set to `true` in `values-global.yaml`.
131+
132+
=== Step 3: Define your pattern content
133+
134+
After initialization, you need to add your operators, applications, and Helm charts to the pattern. There are two approaches:
135+
136+
==== Using the pattern-author AI coding skill
137+
138+
Patternizer installs an AI coding skill to `.claude/skills/pattern-author/` and `.cursor/skills/pattern-author/` during initialization. This skill teaches AI coding assistants such as Claude Code and Cursor how to author Validated Patterns -- defining namespaces, operators, applications, secrets, hub/spoke clusters, and more.
139+
140+
Open the initialized repository in your AI-assisted editor and the skill will be available automatically. You can ask the assistant to add operators, wire in Helm charts, configure secrets, or set up multi-cluster deployments.
141+
142+
==== Manually editing values files
143+
144+
You can directly edit the generated values files to define your pattern:
145+
146+
* Add operator subscriptions and namespaces to `values-prod.yaml`
147+
* Add Helm chart applications to `values-prod.yaml`
148+
* Configure global settings in `values-global.yaml`
149+
* Define secrets in `values-secret.yaml.template`
150+
151+
For detailed guidance on structuring your pattern, see link:/learn/vp_structure_vp_pattern/[Structuring a validated pattern]. For adding operators, see link:/learn/vp_add_ops_to_pattern/[Adding operators to the framework].
152+
153+
[NOTE]
154+
.Idempotency
155+
====
156+
The `pattern init` command is idempotent and can be run multiple times during pattern creation to update the pattern values files. You can go from `pattern init` to `pattern init --with-secrets` to add the secrets framework to your pattern. If you use `helm create` (or `./pattern.sh helm create`) to create Helm charts and then run `pattern init` again, the Helm charts will be automatically added to your `values-prod.yaml`.
157+
====
158+
159+
=== Next steps
160+
161+
* Deploy an existing pattern like link:/learn/getting-started-multi-cloud-gitops/[Multicloud GitOps] to explore how the framework works in practice
162+
* Learn about link:/learn/vp_structure_vp_pattern/[structuring a validated pattern] and best practices
163+
* Add operators to your pattern with link:/learn/vp_add_ops_to_pattern/[Adding operators to the framework]
164+
* Configure secrets with link:/learn/getting-started-secret-management/[Configuring secrets]
165+
* Visit the link:https://github.com/validatedpatterns/patternizer[patternizer repository on GitHub] for the latest documentation

content/learn/getting-started-multi-cloud-gitops.adoc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,19 @@ include::modules/comm-attributes.adoc[]
1414

1515
== Getting Started with Multicloud GitOps
1616

17-
Multicloud GitOps is a foundational pattern that demonstrates GitOps principles for managing applications across multiple clusters. It provides:
17+
Multicloud GitOps is a foundational pattern that demonstrates the core concepts of Validated Patterns in action. Deploying it is a great way to explore how the framework works before creating your own pattern with link:/learn/creating-patterns-with-patternizer/[patternizer]. It provides:
1818

1919
* A GitOps framework using `ArgoCD`
2020
* Infrastructure-as-Code practices
2121
* Multi-cluster management capabilities
22-
* Template for secure secret management
22+
* Secure secret management with HashiCorp Vault
2323

24-
Red Hat recommend the Multicloud GitOps pattern as your base pattern because:
24+
Deploying Multicloud GitOps gives you hands-on experience with:
2525

26-
. It establishes core GitOps practices
27-
. Provides a minimal but complete implementation
28-
. Serves as a foundation for other patterns
29-
. Demonstrates key validated patterns concepts
30-
31-
[NOTE]
32-
====
33-
Other patterns build upon these concepts, making this an ideal starting point for your validated patterns journey.
34-
====
26+
. How operators and applications are defined in values files
27+
. How ArgoCD manages application lifecycle
28+
. How secrets are loaded and managed
29+
. How the pattern framework ties everything together
3530

3631
== Deploying the Multicloud GitOps pattern
3732

content/learn/quickstart.adoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
title: Patterns quick start
44
menu: learn
5-
weight: 20
5+
weight: 18
66
---
77

88
:toc:
@@ -11,17 +11,19 @@ include::modules/comm-attributes.adoc[]
1111

1212
== Patterns quick start overview
1313

14-
This validated pattern quickstart offers a streamlined guide to deploying predefined, reliable configurations and applications, ensuring they meet established standards. It provides step-by-step instructions on setup, prerequisites, and configuration, enabling administrators to deploy tested, supportable patterns quickly. These patterns simplify complex deployments by applying reusable configurations suited to various infrastructure and application needs, allowing users to efficiently deploy, manage, and scale applications with GitOps. This approach also reduces the risks and time associated with custom configurations.
14+
This quickstart helps you get up and running with Validated Patterns -- whether you are creating a new pattern or deploying an existing one.
1515

16-
Validated patterns can be deployed using either the OpenShift-based Validated Patterns framework or the Ansible GitOps Framework (AGOF). The OpenShift-based validated patterns framework is the most common method for deploying applications and infrastructure on the OpenShift Container Platform. It offers a set of predefined configurations and patterns that follow best practices and are validated by Red Hat.
16+
* **link:/learn/creating-patterns-with-patternizer/[Create a new pattern]** -- Use patternizer to bootstrap a Git repository into a ready-to-use Validated Pattern with all required scaffolding.
17+
* **link:/learn/getting-started-multi-cloud-gitops/[Deploy an existing pattern]** -- Deploy the Multicloud GitOps pattern to explore how the framework works in practice.
1718

18-
== Getting Started with Validated Patterns
19+
Validated Patterns can be deployed using either the OpenShift-based Validated Patterns framework or the Ansible GitOps Framework (AGOF). The OpenShift-based Validated Patterns framework is the most common method for deploying applications and infrastructure on the OpenShift Container Platform. It offers a set of predefined configurations and patterns that follow best practices and are validated by Red Hat.
1920

20-
This guide steps you through the process of deploying your first validated pattern on an OpenShift cluster. By the end of this guide, you'll have a working instance of the Multicloud GitOps pattern, which serves as an excellent foundation for exploring other patterns.
21+
== Getting Started with Validated Patterns
2122

2223
=== What You'll Learn
2324

24-
. Setting up prerequisites for validated patterns
25+
. Setting up prerequisites for Validated Patterns
26+
. Creating a new pattern with patternizer
2527
. Installing and configuring the Validated Patterns Operator
2628
. Deploying the Multicloud GitOps pattern
2729
. Managing secrets and configurations
@@ -52,8 +54,7 @@ Before beginning, ensure you have the following:
5254
.For disconnected environments:
5355

5456
* One or more openshift clusters deployed in a disconnected network
55-
* An OCI-compliant registry that is accessible from the disconnected network
57+
* An OCI-compliant registry that is accessible from the disconnected network
5658
* A Git Repository that is accessible from the disconnected network
5759

5860
For more information on disconnected installation, see link:/learn/disconnected-installation/[Deploying in a disconnected network].
59-

content/learn/vp_structure_vp_pattern.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ include::modules/comm-attributes.adoc[]
1616

1717
The high level steps to create a validated pattern are as follows:
1818

19-
1. Identify the business case you want to address.
20-
2. Use the Multicloud GitOps as a starting point by using the template to create a new Git repository in your local GitHub account.
21-
3. Identify the technology components that you need.
19+
1. Identify the business case you want to address.
20+
2. Use link:/learn/creating-patterns-with-patternizer/[patternizer] to bootstrap a new pattern repository with all required scaffolding, or fork an existing pattern such as link:/patterns/multicloud-gitops[Multicloud GitOps] to start from a working example.
21+
3. Identify the technology components that you need.
2222
4. Ensure that the configuration of those components, and the integration points are handled in the pattern.
2323

2424
== Best Practices for creating Validated Patterns
2525

2626
Following these best practices, to create robust, scalable, and maintainable validated patterns that are easy to deploy and manage across various environments.
2727

28-
1. **Start with OpenShift Multicloud GitOps**
29-
- When creating a validated pattern, begin with OpenShift Multicloud GitOps as your foundation. This is the most fundamental pattern and should serve as your base.
28+
1. **Bootstrap your pattern with patternizer**
29+
- When creating a new validated pattern, use link:/learn/creating-patterns-with-patternizer/[patternizer] to generate the required scaffolding. This is the fastest way to get started. Alternatively, you can fork the link:/patterns/multicloud-gitops[Multicloud GitOps] pattern as your foundation if you prefer to work from a fully working example.
3030

3131
2. **Centralize all manifests in a Git Repository**
3232
- Ensure that all pattern manifests, configuration files, and desired state definitions are stored in a Git repository. This provides a single source of truth and facilitates the use of GitOps for deployment.

0 commit comments

Comments
 (0)