Getting started
KubePattern is also my Bachelor Degree Thesis Project and is currently under development. It will be fully open source on march 2026.
Have a look and stay tuned if you have further question please contact me.
A special thanks to Sigemi and for the knoledge the tools and the opportunity to build KubePattern during my internship.
Deploy KubePattern Using Helm
This is the convenient way to deploy KubePattern on your Kubernetes cluster.
Prerequisites
- A Kubernetes cluster (v1.24+)
- Helm (v3.0+)
- kubectl (v1.24+)
- Access to the cluster with sufficient permissions to create resources
Steps to Deploy
To install KubePattern using Helm (Default Values), follow these steps:
helm install my-kubepattern-chart oci://ghcr.io/kubepattern/kubepattern-chart --version <version>
To install KubePattern with custom values, create a values.yaml file with your desired configurations and run:
helm install my-kubepattern-chart oci://ghcr.io/kubepattern/kubepattern-chart --version <version> -f values.yaml
Example values.yaml:
replicaCount: 1
image:
repository: kubepattern # Image repository GHCR
pullPolicy: Always # Container Image pull policy
tag: "latest" # Target KubePattern version
analysis:
# Save in involved resoureces namespace
saveInNamespace: false
# Default output namespace if option save-in-namespace == false for namespaced resources
# Default output namespace for cluster scoped resources
targetNamespace: pattern-analysis-ns
# Deploy Cronjob
schedule: false
# Periodic analysis frequecy es: @hourly
jobFrequency: "0 * * * *"
patternRegistry:
orgName: "kubepattern"
# kubepattern official pattern registry: https://github.com/kubepattern/registry
repo:
branch: "main"
name: "registry"
# For private repositories access
token: ""
Take a Look at Pattern as Code Registry
KubePattern uses an external Pattern Registry to define and manage patterns. You can explore the official registry at KubePattern Registry to see available patterns and their definitions.
You can also create your own registry by following the structure and guidelines provided in the official repository.
//structure example
registry-repo-name/
├── definitions/
│ ├── pattern-1.json
│ ├── pattern-2.json
│ └── ...
├── doc/
│ ├── pattern-1-doc.md
│ ├── pattern-2-doc.md
│ └── ...
└── README.md
Write Your Patterns
You can create custom patterns by defining them in JSON format. Refer to the Pattern Definition Guide for detailed instructions on how to write and structure your patterns.
Then push your patterns to your registry repository in definitions folder and configure KubePattern to use your custom registry by updating the Helm values accordingly.
Run Analysis Manually
You can run KubePattern analysis using the API. Refer to the API Documentation for detailed instructions on how to trigger analysis and retrieve results programmatically.
Manual Analysis Warning
It is not reccomended to expose KubePattern API outside your cluster without proper security measures.
Better way to trigger analysis is run a Job and trigger analysis using curl utility inside the cluster.
Sheduled Analysis
The Better way is to use the Helm chart with Cronjob enabled to run periodic analysis on your cluster.