Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FluxCD ¶
type FluxCD struct {
// Namespace is the Kubernetes namespace where FluxCD components will be installed.
// If empty, defaults to "flux-system".
Namespace string
}
FluxCD is an Extension that installs FluxCD (https://fluxcd.io) into the test environment. FluxCD is a GitOps continuous delivery solution for Kubernetes that keeps clusters in sync with configuration sources (like Git repositories) and automates configuration updates.
This extension installs the following FluxCD components:
- source-controller: Handles source definitions (Git, Helm, OCI repositories)
- kustomize-controller: Applies Kustomize overlays from sources
- helm-controller: Manages Helm releases
- notification-controller: Handles event notifications and webhooks
- image-reflector-controller: Scans container registries for image metadata
- image-automation-controller: Automates image updates in Git
All components are installed into the specified namespace (defaults to "flux-system").
Usage:
openmcp := setup.OpenMCPSetup{
Extensions: []extensions.Extension{
&fluxcd.FluxCD{
Namespace: "custom-flux-ns", // Optional, defaults to "flux-system"
},
},
}
func (*FluxCD) Install ¶
Install deploys FluxCD into the Kubernetes cluster using the native Go API. This method generates FluxCD manifests programmatically and applies them to the cluster, eliminating the need for the external flux CLI tool.
The installation process:
- Generates installation manifests using flux2's manifestgen package
- Splits the multi-document YAML into individual resources
- Unmarshals each resource as an unstructured object
- Creates each resource in the cluster (gracefully handling already-exists errors)
Returns an error if manifest generation or resource creation fails.
func (*FluxCD) RegisterSchemes ¶
RegisterSchemes registers FluxCD's custom resource schemes with the Kubernetes client. This enables the test framework to work with FluxCD custom resources like HelmRelease, Kustomization, GitRepository, HelmRepository, etc.
The following schemes are registered:
- helm-controller (HelmRelease)
- kustomize-controller (Kustomization)
- source-controller (GitRepository, HelmRepository, HelmChart, OCIRepository, Bucket)
Returns an error if any scheme registration fails.