Closed sarataha closed 1 year ago
Closes: https://github.com/weaveworks/weave-gitops-enterprise/issues/2147
This PR implements cluster generator which fetches gitops clusters that match the specified labels, and generates parameters for each cluster. The generated parameters include the cluster name, namespace, labels, and annotations.
Create a gitopscluster with some labels:
kubectl apply -f examples/cluster-generator/gitops-cluster.yaml
Create a gitopsset including a cluster generator, with matching labels:
kubectl apply -k examples/cluster-generator
Ensure a gitopsset is created with 1 resource:
kubectl get gitopsset NAME AGE READY STATUS cluster-sample 19s True 1 resources created
Create another gitopscluster with the same labels:
Ensure the gitopsset is updated and has 2 resources:
kubectl get gitopsset NAME AGE READY STATUS cluster-sample 27s True 2 resources created
Add and remove more gitopsclusters, and ensure the gitopsset is updated each time.
I also think this should watch GitOpsCluster resources, and trigger a reconciliation of related GitOpsSets?
GitOpsCluster
Closes: https://github.com/weaveworks/weave-gitops-enterprise/issues/2147
This PR implements cluster generator which fetches gitops clusters that match the specified labels, and generates parameters for each cluster. The generated parameters include the cluster name, namespace, labels, and annotations.
How to test it?
Create a gitopscluster with some labels:
Create a gitopsset including a cluster generator, with matching labels:
Ensure a gitopsset is created with 1 resource:
Create another gitopscluster with the same labels:
Ensure the gitopsset is updated and has 2 resources:
Add and remove more gitopsclusters, and ensure the gitopsset is updated each time.