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
Copy file name to clipboardExpand all lines: docs/README.md
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,7 @@ We currently provide these generators:
136
136
- [gitRepository](#gitrepository-generator)
137
137
- [matrix](#matrix-generator)
138
138
- [apiClient](#apiclient-generator)
139
+
- [cluster](#cluster-generator)
139
140
140
141
### List generator
141
142
@@ -627,6 +628,75 @@ Whatever result is parsed from the API endpoint will be returned as a map in a s
627
628
628
629
For generation, you might need to use the `repeat` mechanism to generate repeating results.
629
630
631
+
### Cluster generator
632
+
633
+
The cluster generator generates from in-cluster GitOpsCluster resources.
634
+
635
+
For example, this `GitOpsSet` will generate a `Kustomization` resource for each cluster matching the [Label selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/).
The following fields are generated for each GitOpsCluster.
669
+
670
+
- `ClusterName`the name of the cluster
671
+
- `ClusterNamespace`the namespace that this cluster is from
672
+
- `ClusterLabels`the labels from the metadata field on the GitOpsCluster
673
+
- `ClusterAnnotations`the annotations from the metadata field on the GitOpsCluster
674
+
675
+
If the selector is not provided, all clusters from all namespaces will be returned:
676
+
677
+
```yaml
678
+
apiVersion: templates.weave.works/v1alpha1
679
+
kind: GitOpsSet
680
+
metadata:
681
+
name: cluster-sample
682
+
spec:
683
+
generators:
684
+
- cluster: {}
685
+
```
686
+
687
+
Otherwise if the selector is empty, no clusters will be generated:
688
+
689
+
```yaml
690
+
apiVersion: templates.weave.works/v1alpha1
691
+
kind: GitOpsSet
692
+
metadata:
693
+
name: cluster-sample
694
+
spec:
695
+
generators:
696
+
- cluster:
697
+
selector: {}
698
+
```
699
+
630
700
## Templating functions
631
701
632
702
Currently, the [Sprig](http://masterminds.github.io/sprig/) functions are available in the templating, with some functions removed[^sprig] for security reasons.
0 commit comments