Patternizer Skill
When to Use
- Initializing a new Validated Pattern from a Git repository with Helm charts
- Upgrading an existing Validated Pattern to the latest common structure
- Understanding the generated scaffolding files (values-global.yaml, pattern.sh, Makefile)
- Configuring secrets management for Validated Patterns
- Working with the
pattern.shutility script - Troubleshooting pattern initialization or upgrade issues
Instructions
- Read
references/REFERENCE.mdwhen you need the Patternizer CLI reference, container image details, or upstream links - Read
references/README.mdfor the full upstream README including generated file descriptions and contributing workflow - Patternizer runs as a container via Podman or Docker — no local Go installation required
Gotchas
patternizer initoverwrites existing files without warning — always run in a clean directory or commit first- The generated
Makefileincludescommon/Makefilefrom the VP framework — this include must exist ormakewill fail silently values-secret.yaml.templateis the template;values-secret.yamlwith real credentials must NEVER be committed to git- Container images referenced in Helm charts must be accessible from the target OpenShift cluster — air-gapped clusters need mirrored images
- After
patternizer init, runmakeimmediately to verify the scaffolding is valid before making any changes deploy.shandteardown.share safe to commit — they contain no secrets- The
deploy.shpre-check forvalues-secret.yamlis avp-deploy-testsubmission-blocking requirement — a pattern that deploys without this check fails the non-interactive install test
Quick Start
# Navigate to your repository with Helm charts
cd my-pattern-repo
# Initialize as a Validated Pattern
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
quay.io/validatedpatterns/patternizer init
# Initialize with secrets management
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
quay.io/validatedpatterns/patternizer init --with-secrets
Key Commands
# Initialize a new pattern (no secrets)
patternizer init
# Initialize with secrets support (adds Vault + External Secrets Operator)
patternizer init --with-secrets
# Upgrade existing pattern to latest common structure
patternizer upgrade
# Upgrade and replace Makefile
patternizer upgrade --replace-makefile
All commands are typically run via the container image:
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
quay.io/validatedpatterns/patternizer <command>
Independent Deployment Scripts
Every Validated Pattern project should have standalone shell scripts that wrap pattern.sh commands. These scripts live in the pattern repo root, are committed to git (they contain no secrets), and serve as the single entry point for deploying and tearing down the pattern.
When activating this section
Before generating any script, check whether one already exists:
ls deploy.sh teardown.sh
If the scripts exist, use them instead of raw pattern.sh commands. If they do not exist, generate them from the templates below.
After generating:
chmod +x deploy.sh teardown.sh
git add deploy.sh teardown.sh
git commit -m "feat: add independent deploy and teardown scripts"
deploy.sh
#!/usr/bin/env bash
# deploy.sh — generated by patternizer skill
set -euo pipefail
PATTERN_ROOT="${PATTERN_ROOT:-$(cd "$(dirname "$0")" && pwd)}"
cd "$PATTERN_ROOT"
if [ ! -f values-secret.yaml ]; then
echo "ERROR: values-secret.yaml not found."
echo "Copy values-secret.yaml.template, populate it, and place it in the pattern root."
echo "Do NOT commit values-secret.yaml to git."
exit 1
fi
echo "==> Installing Validated Pattern ..."
./pattern.sh make install
echo "==> Install complete. Run vp-deploy-validator to confirm ArgoCD convergence."
teardown.sh
#!/usr/bin/env bash
# teardown.sh — generated by patternizer skill
set -euo pipefail
PATTERN_ROOT="${PATTERN_ROOT:-$(cd "$(dirname "$0")" && pwd)}"
cd "$PATTERN_ROOT"
read -rp "This will uninstall the pattern and remove all ArgoCD Applications. Continue? [y/N] " confirm
[[ "$confirm" =~ ^[Yy]$ ]] || exit 0
echo "==> Uninstalling Validated Pattern ..."
./pattern.sh make uninstall
echo "==> Uninstall complete."
Generated Files
Running patternizer init creates:
| File | Purpose |
|---|---|
values-global.yaml |
Global pattern configuration |
values-<cluster_group>.yaml |
Cluster group-specific values |
pattern.sh |
Utility script for install, upgrade operations |
Makefile |
Simple Makefile including Makefile-common |
Makefile-common |
Core Makefile with pattern-related targets |
ansible.cfg |
Ansible configuration for pattern.sh |
With --with-secrets, additionally:
values-secret.yaml.template— template for defining secrets- Updates
values-global.yamlto enable secret loading
Workflow
# 1. Clone or create your pattern repo
git clone https://github.com/your-org/your-pattern.git
cd your-pattern && git checkout -b initialize-pattern
# 2. Initialize with Patternizer
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
quay.io/validatedpatterns/patternizer init
# 3. Review and commit
git add . && git commit -m 'initialize pattern using patternizer'
git push -u origin initialize-pattern
# 4. Install the pattern on OpenShift
export KUBECONFIG=/path/to/cluster/kubeconfig
./pattern.sh make install
Best Practices
- Use the container image rather than building from source
- See Validated Patterns documentation for pattern design guidance