|
| 1 | +--- |
| 2 | + date: 2025-07-24 |
| 3 | + title: From Helm Charts to Validated Patterns in a Single Command |
| 4 | + summary: This post introduces Patternizer, a new tool to simplify pattern authoring. Learn how to convert your Helm charts into a deployable Validated Pattern by generating all required scaffolding with a single command. |
| 5 | + author: Drew Minnear |
| 6 | + blog_tags: |
| 7 | + - patterns |
| 8 | + - announce |
| 9 | + - patternizer |
| 10 | +--- |
| 11 | +:toc: |
| 12 | +:imagesdir: /images |
| 13 | + |
| 14 | +Validated Patterns provide a powerful, GitOps-based framework for deploying complex cloud-native applications. We have great resources on our link:https://validatedpatterns.io/learn/[Learn] and link:https://play.validatedpatterns.io/vp-workshop/main/index.html[Workshop] pages, but the initial learning curve can seem steep. |
| 15 | + |
| 16 | +For developers who just want to package their applications as a pattern, the most common route has been to clone the `multicloud-gitops` repository and adapt it. While effective, this process can be a hurdle for a prospective author who simply wants to know: "How can I turn my Helm charts into a pattern as quickly and painlessly as possible?" |
| 17 | + |
| 18 | +To bridge this gap, we are thrilled to introduce **link:https://github.com/validatedpatterns/patternizer[Patternizer]**—a new command-line tool designed specifically to address this pain point. |
| 19 | + |
| 20 | +== The Solution: Patternizer |
| 21 | + |
| 22 | +Patternizer is a CLI tool that bootstraps a Git repository containing Helm charts into a ready-to-use Validated Pattern. It automatically generates the necessary scaffolding, configuration files, and utility scripts, so you can get your pattern up and running in minutes. |
| 23 | + |
| 24 | +With Patternizer, you can go from a directory of Helm charts to a fully functional Validated Pattern with a single command. |
| 25 | + |
| 26 | +== Getting Started: A Quick Workflow |
| 27 | + |
| 28 | +Let's walk through an example. All you need is a Git repository containing one or more Helm charts and a container runtime like Podman or Docker. |
| 29 | + |
| 30 | +. **Prepare your repository:** |
| 31 | ++ |
| 32 | +Clone your repository and create a new branch for the pattern initialization. |
| 33 | ++ |
| 34 | +[source,bash] |
| 35 | +---- |
| 36 | +git clone https://github.com/your-org/your-awesome-app.git |
| 37 | +cd your-awesome-app |
| 38 | +git checkout -b feature/initialize-pattern |
| 39 | +---- |
| 40 | + |
| 41 | +. **Initialize the pattern:** |
| 42 | ++ |
| 43 | +Navigate to your repository's root and run the Patternizer container, mounting your current directory. |
| 44 | ++ |
| 45 | +[source,bash] |
| 46 | +---- |
| 47 | +podman run -v "$PWD:/repo:z" quay.io/hybridcloudpatterns/patternizer init |
| 48 | +---- |
| 49 | ++ |
| 50 | +This single command scans your repository for Helm charts and generates all the necessary files to turn it into a Validated Pattern. |
| 51 | + |
| 52 | +. **Review and commit:** |
| 53 | ++ |
| 54 | +Commit the newly generated files to your branch. |
| 55 | ++ |
| 56 | +[source,bash] |
| 57 | +---- |
| 58 | +git add . |
| 59 | +git commit -m 'feat: Initialize Validated Pattern with Patternizer' |
| 60 | +git push -u origin feature/initialize-pattern |
| 61 | +---- |
| 62 | + |
| 63 | +. **Install your new pattern!** |
| 64 | ++ |
| 65 | +Patternizer also generates a handy utility script. You can now install your pattern just like any other Validated Pattern. |
| 66 | ++ |
| 67 | +[source,bash] |
| 68 | +---- |
| 69 | +./pattern.sh make install |
| 70 | +---- |
| 71 | + |
| 72 | +== Under the Hood: What You Get |
| 73 | + |
| 74 | +Running `patternizer init` creates a set of files that form the foundation of your pattern: |
| 75 | + |
| 76 | +* `pattern.sh`: A utility script for common operations like `install` and `upgrade`. |
| 77 | +* `Makefile` & `Makefile-pattern`: The core Makefiles with all the pattern-related build logic. |
| 78 | +* `values-global.yaml`: A place for global pattern configuration. |
| 79 | +* `values-prod.yaml`: A cluster group-specific values file (for the default `prod` group). |
| 80 | + |
| 81 | +The tool is designed to be idempotent. You can continue adding Helm charts to your repository and just rerun the `init` command. It will intelligently update the necessary values files while preserving any manual changes you've made. |
| 82 | + |
| 83 | +== Need Secrets? We've Got You Covered |
| 84 | + |
| 85 | +When your pattern is ready to handle sensitive information, you can easily add scaffolding for secrets management. |
| 86 | + |
| 87 | +Run the `init` command with the `--with-secrets` flag: |
| 88 | + |
| 89 | +[source,bash] |
| 90 | +---- |
| 91 | +podman run -v "$PWD:/repo:z" quay.io/hybridcloudpatterns/patternizer init --with-secrets |
| 92 | +---- |
| 93 | + |
| 94 | +This command updates your configuration to integrate with External Secrets Operator (ESO) and Vault. It generates a `values-secret.yaml.template` for defining your secrets and automatically adds the required operator subscriptions to your pattern. |
| 95 | + |
| 96 | +== Current Scope and Future Direction |
| 97 | + |
| 98 | +Patternizer is in its infancy, and its initial focus is on solving the Helm-to-Pattern problem. As such, there are a few things to keep in mind: |
| 99 | + |
| 100 | +. **Helm-Based Patterns Only:** The tool is currently designed exclusively for creating patterns from Helm charts. If you need an Ansible-based GitOps pattern, this tool will not be helpful. |
| 101 | + |
| 102 | +. **Operators Need Manual Addition:** Patternizer creates the Argo CD `Applications`, `Namespaces`, and `Projects` for your Helm charts. If your pattern requires Operators from OperatorHub, you will need to manually add them to the `subscriptions` section in your cluster group values file (e.g., `values-prod.yaml`). Patternizer conveniently creates this section as an empty map for you. |
| 103 | + |
| 104 | +. **Single Cluster Group Focus:** The tool generates a single cluster group named `prod` by default. If your use case requires managing multiple, distinct cluster groups, we recommend the traditional approach of cloning the `multicloud-gitops` pattern for now. |
| 105 | + |
| 106 | +== We Want Your Feedback! |
| 107 | + |
| 108 | +Patternizer is a simple tool today, but it is extendable to cover more use cases if the need arises. We built it to make your life easier, and your feedback is crucial. |
| 109 | + |
| 110 | +Please give it a try and don't hesitate to ask for features or report bugs on link:https://github.com/validatedpatterns/patternizer/issues[Patternizer's GitHub issues page]. Happy pattern-making! |
0 commit comments