Creating GitOpsTemplates Enterprise
For complete examples of widely-used templates, see the Quickstart guide.
GitOps Templates were originally introduced to enable self-service operations for the the cluster creation workflow.
We have since extended this capability to cover Terraform, Crossplane and general Kubernetes resources.
An example template could, upon merging to a GitOps repository and reconciling in a cluster, provide a running developer environment consisting of an EKS cluster, an RDS database, and a branch and revision of the current application through single template.
Templates can be loaded into the cluster by Platform Operator by adding them to
the Flux-manage GitOps repository for the target cluster. Alternatively, they
can be applied directly to the cluster with
Weave GitOps will search for templates in the
This can be changed by configuring the
config.capi.namespace value in the
Weave GitOps Enterprise Helm Chart.
Template types are used by Weave GitOps to group the templates nicely in the Dashboard UI.
There are 4 recommended template types:
application- for application templates
cluster- for cluster templates
terraform- for Terraform templates
pipeline- for Pipeline templates
Declare this in the object manifest by using the
label and setting the value as the name of the type.
The rendering of certain component sections in a template can be enabled or
disabled with annotations. The annotation keys are of the form
templates.weave.works/COMPONENT-enabled and have
In-UI Template Editing
When rendering a template, a
is added by default to the first resource in the
It can be added to any other resource by simply adding the annotation in empty form. This annotation holds information about which template generated the resource and the parameter values used as a json string.
If the resource type is one of the following and has this annotation, an
Edit resource button will appear in the GitOps UI which allows the editing of
the resource by users, after which it will be re-rendered:
- apiVersion: v1
- apiVersion: source.toolkit.fluxcd.io/v1beta1
# This annotation will add an `Edit resource` button in the UI for this resource