You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second purpose is to demonstrate it by setting up a simple GitOps based Kubernetes deployment with dynamic preview
20
20
environments.
21
21
@@ -27,18 +27,18 @@ from a list of generators (e.g. Git) and an `Application` template.
27
27
28
28
The Template Controller uses a different approach, making it more flexible and independent of the GitOps system being
29
29
used. It uses arbitrary Kubernetes objects as inputs and allows to create templated objects of any kind
30
-
(e.g. a Flux Helm Release or a [KluctlDeployment]({{< ref "docs/gitops/spec/v1beta1/kluctldeployment" >}})).
30
+
(e.g. a Flux Helm Release or a [KluctlDeployment]({{% ref "docs/gitops/spec/v1beta1/kluctldeployment" %}})).
31
31
This makes the controller very extensible, as any type of input can be implemented with the help of additional
32
32
controllers which are not necessarily part of the project.
33
33
34
34
When specifying the input objects, you'd also specify which part of the object to use as input. This is done by
35
35
specifying a [JSON Path](https://goessner.net/articles/JsonPath/) that select the subfield of the object to use, e.g.
36
-
`status.result` for a [GitProjector]({{< ref "docs/template-controller/spec/v1alpha1/gitprojector" >}}) or
36
+
`status.result` for a [GitProjector]({{% ref "docs/template-controller/spec/v1alpha1/gitprojector" %}}) or
37
37
`data` for a ConfigMap.
38
38
39
-
The Template Controller implements this functionality through the [ObjectTemplate]({{< ref "docs/template-controller/spec/v1alpha1/objecttemplate" >}})
39
+
The Template Controller implements this functionality through the [ObjectTemplate]({{% ref "docs/template-controller/spec/v1alpha1/objecttemplate" %}})
40
40
CRD. As the name implies, it also uses a templating engine, which is identical to the one used in
41
-
[Kluctl]({{< ref "docs/kluctl/templating" >}}), with the `ObjectTemplate's` input matrix available as
41
+
[Kluctl]({{% ref "docs/kluctl/templating" %}}), with the `ObjectTemplate's` input matrix available as
42
42
global variables.
43
43
44
44
## Preparation
@@ -143,7 +143,7 @@ when a pull request introduces changes that need to be tested before these are m
143
143
In a GitOps-based setup, one would need to create the relevant custom resources per preview environment, for example
144
144
a [Flux Kustomization](https://fluxcd.io/flux/components/kustomize/kustomization/),
145
145
[Flux HelmRelease](https://fluxcd.io/flux/components/helm/helmreleases/) or a
146
-
or [KluctlDeployment]({{< ref "docs/gitops/spec/v1beta1/kluctldeployment" >}}). The underlying GitOps controller
146
+
or [KluctlDeployment]({{% ref "docs/gitops/spec/v1beta1/kluctldeployment" %}}). The underlying GitOps controller
147
147
would then take over and perform the actual deployment.
148
148
149
149
In the following examples we will concentrate on using `KluctlDeployments`. Changing it to use `Kustomizations` or
@@ -155,7 +155,7 @@ be described in the next chapters.
155
155
## Linking Preview Environments to Branches
156
156
You can, for example, link Git branches to preview environments, so that for each new branch a preview environment is
157
157
created, with configuration being read from a yaml file inside the branch. This can be achieved by using a
158
-
[GitProjector]({{< ref "docs/template-controller/spec/v1alpha1/gitprojector" >}}), which will periodically
158
+
[GitProjector]({{% ref "docs/template-controller/spec/v1alpha1/gitprojector" %}}), which will periodically
159
159
clone the configured Git repository, scan for matching branches and files and project the result into the `GitProjector`
160
160
status. The status is then available as matrix input inside the `ObjectTemplate`.
161
161
@@ -235,7 +235,7 @@ spec:
235
235
Please note the use of templating variables and filters inside the actual template under `spec.templates`. Each template
236
236
will be rendered once per matrix input, which in this case means once per branch. The templates can use the current
237
237
matrix input in the form of a variable, accessible via `matrix.<name>`, e.g. `matrix.git` in this case. Please read
238
-
the documentation of [GitProjector]({{< ref "docs/template-controller/spec/v1alpha1/gitprojector" >}}) to figure
238
+
the documentation of [GitProjector]({{% ref "docs/template-controller/spec/v1alpha1/gitprojector" %}}) to figure
239
239
out what is available in `matrix.git`, which is basically just a copy of the individual `status.result` list items.
240
240
241
241
## One Preview Environment per pull requests
@@ -244,8 +244,8 @@ be useful if you want to report the status of your preview environment to the pu
244
244
commit status when the deployment turns green or red. One might also want to post complex status comments, for example
245
245
the result of the deployment in the form of structured and beautiful diff.
246
246
247
-
To achieve this, you can use the [ListGithubPullRequests]({{< ref "docs/template-controller/spec/v1alpha1/listgithubpullrequests" >}})
248
-
or the [ListGitlabMergeRequests]({{< ref "docs/template-controller/spec/v1alpha1/listgitlabmergerequests" >}})
247
+
To achieve this, you can use the [ListGithubPullRequests]({{% ref "docs/template-controller/spec/v1alpha1/listgithubpullrequests" %}})
248
+
or the [ListGitlabMergeRequests]({{% ref "docs/template-controller/spec/v1alpha1/listgitlabmergerequests" %}})
249
249
custom resource, which are also provided by the Template Controller.
0 commit comments