A lightweight Kubernetes controller that integrates vCluster Platform with Flux by automatically creating Flux Kubeconfig reference Secrets for VirtualClusterInstances (VCIs). These Secrets can then be used as references for Flux HelmRelease or Kustomization resources, enabling seamless GitOps deployments into dynamic vCluster instances.
The controller:
- Watches for
VirtualClusterInstance(VCI) resources that match a configurable label selector (defaults tovcluster.com/import-fluxcd=true. - Generates a corresponding kubeconfig
Secretin one or more designated namespaces. - Copies all
.metadata.labelsfrom theVirtualClusterInstanceinto the generatedSecretfor downstream use. - Cleans up the generated
Secretwhen the associatedVirtualClusterInstanceis deleted.
This makes it possible to dynamically provision vClusters on the vCluster Platform and immediately bootstrap workloads into them using Flux.
- Selective Sync: Only VCIs matching the configured label selector are mirrored into
Secrets. - Label Propagation: All VCI labels are added to the generated
Secret, making them available for FluxClusterGeneratoror other label-driven automation. - Kubeconfig Management: Automatically manages lifecycle of kubeconfig
Secretsfor Flux. - Automatic Cleanup: When a VCI is removed or no longer matches the selector, the corresponding
Secretis deleted.