### Install Flux Controllers with FluxInstance Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/README.md Create a FluxInstance resource to install the latest stable version of Flux. This example shows how to specify the Flux version, artifact registry, components to install, and cluster configuration, including custom kustomize patches. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: FluxInstance metadata: name: flux namespace: flux-system annotations: fluxcd.controlplane.io/reconcileEvery: "1h" fluxcd.controlplane.io/reconcileArtifactEvery: "10m" fluxcd.controlplane.io/reconcileTimeout: "5m" spec: distribution: version: "2.x" registry: "ghcr.io/fluxcd" artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests" components: - source-controller - kustomize-controller - helm-controller - notification-controller - image-reflector-controller - image-automation-controller cluster: type: kubernetes size: medium multitenant: false networkPolicy: true domain: "cluster.local" kustomize: patches: - target: kind: Deployment patch: | - op: replace path: /spec/template/spec/nodeSelector value: kubernetes.io/os: linux - op: add path: /spec/template/spec/tolerations value: - key: "CriticalAddonsOnly" operator: "Exists" ``` -------------------------------- ### Example Flux Distribution Information Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxreport.md Shows example distribution information when Flux was installed using the bootstrap command. ```yaml spec: distribution: entitlement: Issued by controlplane managedBy: 'flux bootstrap' status: Installed version: v2.3.0 ``` -------------------------------- ### Git Repository Skill Structure Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Demonstrates how skills are organized within a Git repository, similar to the fluxcd/agent-skills example. ```text fluxcd/agent-skills/ ├── skills/ │ ├── gitops-cluster-debug/ │ │ ├── SKILL.md │ │ ├── assets/ │ │ ├── evals/ │ │ └── references/ │ └── gitops-repo-audit/ │ ├── SKILL.md │ ├── assets/ │ ├── evals/ │ ├── references/ │ └── scripts/ └── .github/workflows/ └── publish.yml ``` -------------------------------- ### Filter Configuration Examples Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourcesetinputprovider.md Examples of YAML configurations for filtering change requests, tags, and semver versions. ```yaml spec: filter: limit: 10 labels: - "deploy::flux-preview" includeBranch: "^feat/.*" excludeBranch: "^feat/not-this-one$" ``` ```yaml spec: filter: includeTag: "^v[0-9]+\\.[0-9]+\\.[0-9]+$" # include tags like v1.2.3 excludeTag: "^v0" # exclude tags like v0.1.0 ``` ```yaml spec: filter: limit: 1 semver: ">=1.0.0" ``` -------------------------------- ### Schedule with a Non-Zero Window Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/resourcesets/rset-time-based-delivery.md This example demonstrates a schedule with a defined window, allowing reconciliations to occur within a specified duration after the scheduled time. The reconciliation will start at the scheduled time and continue until the window closes. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: ResourceSetInputProvider metadata: annotations: fluxcd.controlplane.io/reconcileEvery: "10m" spec: schedule: - cron: "0 8 * * 1-5" timeZone: "UTC" window: "8h" ``` -------------------------------- ### Install Single Skill Source Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs skills from a specified OCI repository. Ensure the repository is correctly configured in your catalog. ```shell flux-operator skills install ghcr.io/fluxcd/agent-skills ``` -------------------------------- ### Start Review Environment with Flux Operator CLI Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/resourcesets/rset-gitlab-environments.md This GitLab CI/CD job starts a review environment by reconciling the ResourceSetInputProvider and ResourceSet using the flux-operator CLI. It requires an image with the flux-operator CLI and kubectl installed and configures the Kubernetes context using a GitLab Agent. ```yaml start-review: stage: review environment: name: review/$CI_COMMIT_REF_SLUG # Matches configuration in the ResourceSet url: https://app-$CI_ENVIRONMENT_SLUG.example.com action: start on_stop: "stop-review" # We need an image with a shell, the flux-operator CLI and kubectl installed image: flux-operator-cli script: | # Set up Kubernetes context using GitLab Agent kubectl config use-context kubernetes_agent # Reconcile both the ResourceSetInputProvider and the ResourceSet flux-operator reconcile inputprovider --namespace app-preview --timeout 1m app-review-environments flux-operator reconcile resourceset --namespace app-preview --timeout 1m app-preview ``` -------------------------------- ### Install Flux Operator as a plugin Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/cmd/cli/README.md Use the Flux CLI to install the operator plugin. ```shell flux plugin install operator ``` -------------------------------- ### Install Flux MCP Server with Homebrew Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/cmd/mcp/README.md Use this command to install the Flux MCP Server via Homebrew. Ensure Homebrew is installed and updated. ```shell brew install controlplaneio-fluxcd/tap/flux-operator-mcp ``` -------------------------------- ### Install Skills with Agent Symlinks Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs skills and creates per-skill symlinks from agent-specific directories to the canonical skill location. This allows agents to find skills in their expected paths. ```shell flux-operator skills install ghcr.io/my-org/agent-skills \ --agent claude-code --agent kiro ``` -------------------------------- ### Install Flux Operator CLI Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-install.md Commands for installing the CLI tool and bootstrapping the operator using a configuration file. ```shell brew install controlplaneio-fluxcd/tap/flux-operator ``` ```shell flux-operator install -f flux-instance.yaml ``` -------------------------------- ### Bootstrap Flux CLI Command Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-migration.md Example command used to bootstrap a cluster with the Flux CLI. ```shell flux bootstrap github \ --components-extra=source-watcher \ --owner=my-org \ --repository=my-fleet \ --branch=main \ --path=clusters/my-cluster ``` -------------------------------- ### flux-operator install Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/cmd/cli/README.md Installs the Flux Operator and a Flux instance in the cluster. ```APIDOC ## flux-operator install ### Description Installs the Flux Operator and a Flux instance in the cluster. This command is intended for development and testing purposes. ### Parameters - **--instance-file, -f** (string) - Optional - Path to FluxInstance YAML file (local file, OCI or HTTPS URL). - **--instance-distribution-version** (string) - Optional - Flux distribution version. - **--instance-distribution-registry** (string) - Optional - Container registry to pull Flux images from. - **--instance-distribution-artifact** (string) - Optional - OCI artifact containing the Flux distribution manifests. - **--instance-components** (string) - Optional - List of Flux components to install. - **--instance-components-extra** (string) - Optional - Additional Flux components to install on top of the default set. - **--instance-cluster-type** (string) - Optional - Cluster type (kubernetes, openshift, aws, azure, gcp). - **--instance-cluster-size** (string) - Optional - Cluster size profile for vertical scaling (small, medium, large). - **--instance-cluster-domain** (string) - Optional - Cluster domain used for generating the FQDN of services. - **--instance-cluster-multitenant** (boolean) - Optional - Enable multitenant lockdown for Flux controllers. - **--instance-cluster-network-policy** (boolean) - Optional - Restrict network access to the current namespace. - **--instance-sync-url** (string) - Optional - URL of the source for cluster sync (Git repository URL or OCI repository address). - **--instance-sync-ref** (string) - Optional - Source reference for cluster sync (Git ref name or OCI tag). - **--instance-sync-path** (string) - Optional - Path to the manifests directory in the source. - **--instance-sync-creds** (string) - Optional - Credentials for the source in the format username:token. - **--instance-sync-gha-app-id** (string) - Optional - GitHub App ID for the sync source credentials. - **--instance-sync-gha-installation-id** (string) - Optional - GitHub App Installation ID. - **--instance-sync-gha-installation-owner** (string) - Optional - GitHub App Installation Owner. - **--instance-sync-gha-private-key-file** (string) - Optional - Path to GitHub App private key file. - **--instance-sync-gha-base-url** (string) - Optional - GitHub base URL for GitHub Enterprise Server. - **--auto-update** (boolean) - Optional - Enable automatic updates of the Flux Operator from the distribution artifact. - **--verify** (boolean) - Optional - Verify the cosign signature of the distribution artifact before installing. - **--certificate-identity-regexp** (string) - Optional - Certificate identity regexp for signature verification. - **--certificate-oidc-issuer** (string) - Optional - OIDC issuer for signature verification. - **--trusted-root** (string) - Optional - Path to a trusted_root.json file for offline signature verification. ``` -------------------------------- ### Install Flux Web UI with Helm Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/web/web-standalone.md Deploy the Flux Web UI using the Flux Operator Helm chart with specific configurations for server-only installation. Ensure CRDs are managed appropriately based on your cluster setup. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: ResourceSet metadata: name: flux-web namespace: flux-system spec: inputs: - version: "*" resources: - apiVersion: source.toolkit.fluxcd.io/v1 kind: OCIRepository metadata: name: << inputs.provider.name >> namespace: << inputs.provider.namespace >> spec: interval: 30m url: oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator layerSelector: mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip" operation: copy ref: semver: << inputs.version | quote >> - apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: << inputs.provider.name >> namespace: << inputs.provider.namespace >> spec: interval: 30m releaseName: flux-web serviceAccountName: flux-operator chartRef: kind: OCIRepository name: << inputs.provider.name >> values: fullnameOverride: flux-web installCRDs: false web: serverOnly: true ``` -------------------------------- ### Install Flux Operator via Homebrew Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/cmd/cli/README.md Install the standalone CLI on macOS or Linux using Homebrew. ```shell brew install controlplaneio-fluxcd/tap/flux-operator ``` -------------------------------- ### install_flux_instance Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/tools.md Installs the Flux Operator and a Flux instance on a Kubernetes cluster using a provided manifest URL. ```APIDOC ## install_flux_instance ### Description Installs Flux Operator and a Flux instance on the cluster from a manifest URL. ### Parameters - **instance_url** (string) - Required - The URL pointing to the Flux Instance manifest file (supports HTTPS and OCI URLs). - **timeout** (string) - Optional - The installation timeout duration (default: 5m). ### Output Returns a detailed installation log including deployed resources with their change status. ``` -------------------------------- ### Configure distribution registry mirrors Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md Examples for using registry mirrors with specific variants in corporate environments. ```yaml spec: distribution: version: "2.8.x" registry: "my-ghcr-mirror.io/fluxcd" variant: "upstream-alpine" ``` ```yaml spec: distribution: version: "2.8.x" registry: "my-ghcr-mirror.io/controlplaneio-fluxcd/distroless" variant: "enterprise-distroless" ``` -------------------------------- ### Skill Directory Structure Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Illustrates the typical file and directory layout for an AI Agent Skill, including required and optional components. ```text my-skill/ ├── SKILL.md # Required: instructions + metadata ├── scripts/ # Optional: executable code ├── references/ # Optional: documentation └── assets/ # Optional: templates, schemas ``` -------------------------------- ### Install Skills with Offline Verification Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md In air-gapped environments, use offline verification with a Sigstore trusted root JSON file to ensure secure installation without direct network access to verification services. ```shell flux-operator skills install ghcr.io/my-org/agent-skills \ --verify-trusted-root /path/to/trusted_root.json ``` -------------------------------- ### Skip Configuration Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourcesetinputprovider.md Configuration for skipping input updates based on label matching criteria. ```yaml spec: filter: labels: - "deploy:flux-preview" skip: labels: - "deploy/flux-preview-pause" - "!test-build-push/passed" ``` -------------------------------- ### SKILL.md Metadata Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Shows the YAML frontmatter and Markdown content structure for a SKILL.md file, defining skill metadata and instructions. ```yaml --- name: my-skill description: What the skill does and when to use it license: Apache-2.0 allowed-tools: Read Grep Glob Bash(scripts/my-script.sh:*) compatibility: Scripts require awk, git, flux-operator CLI --- # My Skill Instructions for the AI agent on how to use this skill. ``` -------------------------------- ### flux-operator skills install Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/cmd/cli/README.md Installs AI agent skills from an OCI artifact into the local .agents/skills directory. ```APIDOC ## flux-operator skills install ### Description Installs skills from an OCI artifact. Skills are tracked via a catalog.yaml file. ### Parameters - **repository** (string) - Required - The OCI artifact repository. - **--tag** (string) - Optional - OCI artifact tag (default: latest). - **--skill** (string) - Optional - Skill name(s) to install (default: all). - **--agent** (string) - Optional - Agent ID(s) for skill symlinks. - **--verify** (boolean) - Optional - Verify cosign signature (default: true). - **--verify-oidc-issuer** (string) - Optional - OIDC issuer for verification. - **--verify-oidc-subject-regex** (string) - Optional - OIDC subject regexp. - **--verify-trusted-root** (string) - Optional - Path to trusted_root.json. ``` -------------------------------- ### Configure ResourceSet with Permute Strategy Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourceset.md Example of a ResourceSet using the Permute strategy to combine inputs from multiple ResourceSetInputProviders. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: ResourceSet metadata: name: my-rset namespace: default spec: inputStrategy: name: Permute inputs: - id: id1 someField: foo - id: id2 someField: bar inputsFrom: - kind: ResourceSetInputProvider name: git-tag - kind: ResourceSetInputProvider name: oci-tag resources: - apiVersion: v1 kind: ConfigMap metadata: name: my-cm-<< inputs.id >> namespace: default data: rsetID: << inputs.my_rset.id | quote >> rsipGitID: << inputs.git_tag.id | quote >> rsipOCIID: << inputs.oci_tag.id | quote >> someField: << inputs.my_rset.someField | quote >> sha: << inputs.git_tag.sha | quote >> digest: << inputs.oci_tag.digest | quote >> ``` -------------------------------- ### Install Specific Skill from Multiple Sources Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs a specific skill from a custom OCI repository, targeting particular agents and versions. This command requires specifying the agent, skill name, and tag. ```shell flux-operator skills install ghcr.io/my-org/skills \ --agent github-copilot \ --skill my-skill \ --tag v2.0.0 ``` -------------------------------- ### Start Vite Dev Server Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/CONTRIBUTING.md Starts the Vite development server for the web UI. This server proxies API requests to the Go backend running on port 35000. ```shell make web-dev ``` -------------------------------- ### ExternalService ResourceSetInputProvider Configuration Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourcesetinputprovider.md Configuration example for a ResourceSetInputProvider using the ExternalService type. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: ResourceSetInputProvider metadata: name: my-orchestrator namespace: apps annotations: fluxcd.controlplane.io/reconcileEvery: "5m" spec: type: ExternalService url: https://my-orchestrator.com/api/v1/flux/inputs?env=prod&app=app1 secretRef: name: orchestrator-auth certSecretRef: name: orchestrator-tls ``` -------------------------------- ### Install GitOps Agent Skills via CLI Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/mcp-prompting.md Installs the official GitOps Agent Skills for the Flux MCP using the Flux Operator CLI. ```shell flux-operator skills install ghcr.io/fluxcd/agent-skills --agent claude-code ``` -------------------------------- ### List Installed Skills Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Lists all installed skills, displaying their name, repository, tag, digest, and last update timestamp. This provides an overview of the current skill inventory. ```shell flux-operator skills list ``` -------------------------------- ### Flux Web UI Configuration Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/web/web-config-api.md A basic YAML configuration file for the Flux Web UI server using OAuth2 authentication. ```yaml # /etc/flux-status-page/config.yaml apiVersion: web.fluxcd.controlplane.io/v1 kind: Config spec: baseURL: https://flux-web.example.com authentication: type: OAuth2 oauth2: provider: OIDC clientID: clientSecret: issuerURL: https://dex.example.com ``` -------------------------------- ### FluxInstance Metric Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md A sample representation of the flux_instance_info metric with populated label values. ```text flux_instance_info{ exported_namespace="flux-system", kind="FluxInstance", name="flux", ready="True", reason="ReconciliationSucceeded", registry="ghcr.io/fluxcd", revision="v2.3.0@sha256:75aa209c6a2e25b97114ccf092246d02ab4363bc136edefc239d2a88da882b63", suspended="False", uid="16ca7202-9319-445b-99d0-617c25bda182" } ``` -------------------------------- ### Install Specific Skill Version Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs a specific version of skills from a ghcr.io repository. Ensure the tag corresponds to the desired version. ```shell flux-operator skills install ghcr.io/my-org/agent-skills --tag v1.0.0 ``` -------------------------------- ### Install Specific Skills from Artifact Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs only specified skills from an OCI artifact, rather than all available skills. The selected skills are recorded in `catalog.yaml`. ```shell flux-operator skills install ghcr.io/my-org/agent-skills \ --skill gitops-cluster-debug \ --skill gitops-repo-audit ``` -------------------------------- ### Install Skills from OCI Registry Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Installs skills from a ghcr.io repository with the latest tag and automatic signature verification. The OIDC issuer and subject regex are derived automatically from the registry path. ```shell flux-operator skills install ghcr.io/my-org/agent-skills ``` -------------------------------- ### Configure and connect via Streamable HTTP Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/mcp-config.md Start the server with the http transport flag and connect using the specified MCP server configuration. ```shell export KUBECONFIG=$HOME/.kube/config flux-operator-mcp serve --transport http --port 8080 ``` ```json { "mcp": { "servers": { "flux-operator-mcp": { "type": "http", "url": "http://localhost:8080/mcp" } } } } ``` -------------------------------- ### ResourceSet Inventory Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourceset.md Displays the structure of the status.inventory field, which tracks successfully applied Kubernetes objects. ```yaml status: inventory: entries: - id: apps_podinfo_helm.toolkit.fluxcd.io_HelmRelease v: v2 - id: apps_podinfo_source.toolkit.fluxcd.io_OCIRepository v: v1 ``` -------------------------------- ### Configure Basic OIDC Authentication Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/web/web-config-api.md Standard OIDC setup requiring a client ID, secret, and issuer URL. ```yaml apiVersion: web.fluxcd.controlplane.io/v1 kind: Config spec: baseURL: https://flux-web.example.com authentication: type: OAuth2 oauth2: provider: OIDC clientID: flux-web clientSecret: my-client-secret issuerURL: https://dex.example.com ``` -------------------------------- ### Configure OpenShift cluster settings Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md Example configuration for an OpenShift cluster, including multi-tenancy and network policy settings. ```yaml spec: cluster: type: openshift size: medium multitenant: true multitenantWorkloadIdentity: true objectLevelWorkloadIdentity: true tenantDefaultServiceAccount: "flux" tenantDefaultDecryptionServiceAccount: "flux-decryption" tenantDefaultKubeConfigServiceAccount: "flux-kubeconfig" networkPolicy: true domain: "cluster.local" ``` -------------------------------- ### Define custom FluxInstance configuration Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/instance/instance-controllers.md Example of a highly customized FluxInstance including multi-tenancy, persistent storage, and Kustomize patches. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: FluxInstance metadata: name: flux namespace: flux-system annotations: fluxcd.controlplane.io/reconcileEvery: "1h" fluxcd.controlplane.io/reconcileTimeout: "5m" spec: distribution: version: "2.8.x" registry: "ghcr.io/fluxcd" artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests" components: - source-controller - kustomize-controller - helm-controller - notification-controller - image-reflector-controller - image-automation-controller - source-watcher cluster: type: kubernetes size: large multitenant: true tenantDefaultServiceAccount: flux networkPolicy: true domain: "cluster.local" storage: class: "standard" size: "10Gi" kustomize: patches: - target: kind: Deployment patch: | - op: replace path: /spec/template/spec/nodeSelector value: kubernetes.io/os: linux - op: add path: /spec/template/spec/tolerations value: - key: "CriticalAddonsOnly" operator: "Exists" ``` -------------------------------- ### get_flux_instance Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/tools.md Retrieves detailed information about the Flux installation, including version, component status, and sync statistics. ```APIDOC ## get_flux_instance ### Description Retrieves detailed information about the Flux installation, including version, component status, and sync statistics. ### Parameters None ### Output Returns comprehensive details about the Flux instance configuration. ``` -------------------------------- ### Define a minimal FluxInstance resource Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/instance/instance-controllers.md Use this YAML manifest to perform a basic installation of Flux within the cluster. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: FluxInstance metadata: name: flux namespace: flux-system spec: distribution: version: "2.8.x" registry: "ghcr.io/fluxcd" cluster: type: kubernetes size: medium ``` -------------------------------- ### Example Flux Components Information Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxreport.md Details the Flux controllers, including image repository, tag, digest, and readiness status. ```yaml spec: components: - image: ghcr.io/fluxcd/kustomize-controller:v1.3.0@sha256:48a032574dd45c39750ba0f1488e6f1ae36756a38f40976a6b7a588d83acefc1 name: kustomize-controller ready: true status: 'Current Deployment is available. Replicas: 1' - image: ghcr.io/fluxcd/source-controller:v1.3.0@sha256:161da425b16b64dda4b3cec2ba0f8d7442973aba29bb446db3b340626181a0bc name: source-controller ready: true status: 'Current Deployment is available. Replicas: 1' ``` -------------------------------- ### Run the CLI Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/dev/README.md Execute the CLI to retrieve instance information. ```sh ./bin/flux-operator-cli get instance flux -n flux-system ``` -------------------------------- ### Apply sample instance Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/dev/README.md Deploy a Flux instance from the samples directory. ```sh kubectl -n flux-system apply -f config/samples/fluxcd_v1_fluxinstance.yaml ``` -------------------------------- ### Build Flux MCP Server from Source Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/mcp-install.md Clone the repository and build the binary using make. Requires Go 1.26 or higher. ```shell git clone https://github.com/controlplaneio-fluxcd/flux-operator.git cd flux-operator make mcp-build ``` -------------------------------- ### Build the project Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/dev/README.md Run this command after making code changes to build the project. ```sh make all ``` -------------------------------- ### Monitor Flux Installation with FluxReport Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/README.md Get the FluxReport resource in the 'flux-system' namespace to monitor the Flux deployment status. The report provides details on readiness, reconciler statistics, CRD versions, and sync status. ```shell kubectl get fluxreport/flux -n flux-system -o yaml ``` -------------------------------- ### Apply and verify FluxInstance Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-migration.md Apply the configuration and check the status of the Flux resources. ```shell kubectl apply -f flux-instance.yaml kubectl -n flux-system wait fluxinstance/flux --for=condition=Ready flux get source oci flux-system flux get kustomization flux-system ``` -------------------------------- ### Install Flux Operator with Helm Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/README.md Installs the Flux Operator in the flux-system namespace using Helm. Ensure Helm is installed and configured before running this command. ```shell helm install flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator \ --namespace flux-system ``` -------------------------------- ### Deploy Dex with Static Users using ResourceSet Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/web/web-sso-dex.md Use this ResourceSet to deploy Dex as a standalone OIDC provider with a static user. Ensure you replace placeholders like '' and '' with your specific values. The configuration includes static clients and passwords, and sets up ingress with TLS. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: ResourceSet metadata: name: dex namespace: flux-system annotations: fluxcd.controlplane.io/reconcileEvery: "30m" fluxcd.controlplane.io/reconcileTimeout: "5m" spec: wait: true inputs: - domain: "" ingressClass: "" resources: - apiVersion: v1 kind: Namespace metadata: name: dex - apiVersion: v1 kind: Secret metadata: name: flux-web-client namespace: dex annotations: fluxcd.controlplane.io/copyFrom: "flux-system/flux-web-client" - apiVersion: v1 kind: Secret metadata: name: cluster-tls namespace: dex annotations: fluxcd.controlplane.io/copyFrom: "flux-system/cluster-tls" - apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: dex namespace: dex spec: interval: 1h url: https://charts.dexidp.io - apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: dex namespace: dex spec: chart: spec: chart: dex version: "*" sourceRef: kind: HelmRepository name: dex interval: 1h releaseName: dex values: config: issuer: "https://dex.<< inputs.domain >>" storage: type: memory staticClients: - id: flux-web redirectURIs: - "https://flux.<< inputs.domain >>/oauth2/callback" enablePasswordDB: true staticPasswords: - email: "admin@<< inputs.domain >>" # bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2) hash: "$2y$10$KR7JHCQ1BxNAKBOR/ixKqevGKtvtZnpgwvV/jF80eN5zLHVHx24E2" username: "admin" userID: "08a8684b-db88-4b73-90a9-3cd1661f5466" ingress: enabled: true className: "<< inputs.ingressClass >>" hosts: - host: "dex.<< inputs.domain >>" paths: - path: / pathType: ImplementationSpecific tls: - secretName: cluster-tls hosts: - "*.<< inputs.domain >>" valuesFrom: - kind: Secret name: flux-web-client valuesKey: client-id targetPath: config.staticClients[0].name - kind: Secret name: flux-web-client valuesKey: client-secret targetPath: config.staticClients[0].secret ``` -------------------------------- ### Install Skills with Explicit OIDC Verification Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md For non-ghcr.io registries, explicitly provide OIDC verification flags for secure installation. This ensures the integrity of the installed skills. ```shell flux-operator skills install docker.io/my-org/skills \ --verify-oidc-issuer=https://token.actions.githubusercontent.com \ --verify-oidc-subject-regex='^https://github\.com/my-org/.*$' ``` -------------------------------- ### Run Web Server with Custom Config Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/CONTRIBUTING.md Launches the web server using a specified configuration file, such as the cluster-admin web-config.yaml. ```shell make web-run WEB_RUN_ARGS=--web-config=web-config.yaml ``` -------------------------------- ### Install Skills Skipping Verification Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Skips signature verification entirely during installation. This is not recommended for production environments due to security risks. ```shell flux-operator skills install ghcr.io/my-org/agent-skills --verify=false ``` -------------------------------- ### Install Flux Operator with Helm Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourceset.md Use this command to install the flux-operator via Helm with multi-tenancy enabled and a custom default service account. ```shell helm install flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator \ --namespace flux-system \ --create-namespace \ --set multitenancy.enabled=true \ --set multitenancy.defaultServiceAccount=flux-operator ``` -------------------------------- ### Verify FluxInstance patches with CLI Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/instance/instance-customization.md Build the FluxInstance locally to preview generated manifests before applying them to the cluster. ```bash flux-operator build instance -f flux.yaml ``` -------------------------------- ### Apply ResourceSetInputProvider Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourcesetinputprovider.md Deploys the provider manifest to the cluster. ```shell kubectl apply -f flux-appx-prs.yaml.yaml ``` -------------------------------- ### Flux Report Sync Status Example Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/config/terraform/README.md This is an example of the sync status output for a FluxReport resource, indicating a successful sync with the specified Git revision. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: FluxReport metadata: name: flux namespace: flux-system spec: # Distribution status omitted for brevity sync: id: kustomization/flux-system path: config/terraform/clusters/staging ready: true source: https://github.com/controlplaneio-fluxcd/flux-operator.git status: 'Applied revision: refs/heads/main@sha1:21486401be9bcdc37e6ebda48a3b68f8350777c9' ``` -------------------------------- ### GitLab CI/CD for Environment Deployment Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/resourcesets/rset-gitlab-environments.md An example .gitlab-ci.yml snippet that defines a 'review' stage. This stage is intended to create a GitLab Environment and potentially trigger a reconciliation of the ResourceSetInputProvider, tying deployment success to the environment's validity. ```yaml stages: - review ``` -------------------------------- ### Configure and connect via Server-Sent Events Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/mcp/mcp-config.md Start the server with the sse transport flag and connect using the specified MCP server configuration. Note that this transport mode is considered legacy. ```shell export KUBECONFIG=$HOME/.kube/config flux-operator-mcp serve --transport sse --port 8080 ``` ```json { "mcp": { "servers": { "flux-operator-mcp": { "type": "sse", "url": "http://localhost:8080/sse" } } } } ``` -------------------------------- ### Repository Structure Overview Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/AGENTS.md Visual representation of the project directory layout. ```bash ├── api/ # Go API definitions for Kubernetes CRDs ├── cmd/ # Main entrypoint for the binaries │ ├── cli/ # Flux Operator CLI │ ├── mcp/ # Flux Operator MCP Server │ └── operator/ # Flux Operator Kubernetes Controller ├── config/ # Kubernetes manifests for deploying the operator ├── docs/ # Kubernetes APIs and MCP tools documentation ├── hack/ # Scripts for development, building, and releases ├── internal/ # Internal Go packages │ ├── controller/ # Controller reconciliation logic │ └── web/ # Backend for the Flux Status Page ├── test/ # End-to-end tests with Kubernetes Kind └── web/ # Preact frontend for the Flux Status Page ``` -------------------------------- ### Vet Current Package Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/config/testdata/skills/go-check/SKILL.md Run `go vet` to analyze all packages within the current directory. ```bash go vet ./... ``` -------------------------------- ### Update All Installed Skills Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Updates all installed skills to their latest remote versions by checking each source in `catalog.yaml` and pulling new content when changes are detected. Tampered or deleted local skills are restored. ```shell flux-operator skills update ``` -------------------------------- ### Create a Kind cluster Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/dev/README.md Initialize a local Kubernetes cluster using Kind for testing. ```sh kind create cluster ``` -------------------------------- ### ResourceSetInputProvider Schedule Status Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/resourcesetinputprovider.md Example of the status field when reconciliation is scheduled. ```yaml status: nextSchedule: cron: 0 8 * * 1-5 timeZone: Europe/London when: "2025-06-29T00:00:00Z" window: 8h ``` -------------------------------- ### Install Flux Operator with Terraform Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-install.md Uses the flux-operator-bootstrap module to deploy the operator and a Flux instance. ```hcl module "flux_operator_bootstrap" { source = "controlplaneio-fluxcd/flux-operator-bootstrap/kubernetes" revision = var.bootstrap_revision gitops_resources = { instance_yaml = file("${path.root}/clusters/staging/flux-system/flux-instance.yaml") } } ``` -------------------------------- ### Run Flux Operator Web UI with Live Backend Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/CONTRIBUTING.md Starts the Go HTTP server to serve the web UI connected to a live backend. This command should be run in a separate terminal. ```shell # Terminal 1: Start the status web server make web-run ``` -------------------------------- ### Configure image pull secret Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md Examples for authenticating with private registries using Kubernetes secrets. ```yaml spec: distribution: version: "2.8.x" registry: "ghcr.io/controlplaneio-fluxcd/distroless" imagePullSecret: "flux-enterprise-auth" ``` ```sh echo $ENTERPRISE_TOKEN | flux-operator create secret registry flux-enterprise-auth \ --namespace=flux-system \ --server=ghcr.io \ --username=flux \ --password-stdin ``` -------------------------------- ### Run unit tests Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/dev/README.md Execute the unit test suite. ```sh make test ``` -------------------------------- ### View Flux component status Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md Displays the image repository, tag, and digest for each installed Flux component. ```text Status: Components: Digest: sha256:161da425b16b64dda4b3cec2ba0f8d7442973aba29bb446db3b340626181a0bc Name: source-controller Repository: ghcr.io/fluxcd/source-controller Tag: v1.3.0 Digest: sha256:48a032574dd45c39750ba0f1488e6f1ae36756a38f40976a6b7a588d83acefc1 Name: kustomize-controller Repository: ghcr.io/fluxcd/kustomize-controller Tag: v1.3.0 ``` -------------------------------- ### Run Flux Operator Web UI in Development Mode Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/CONTRIBUTING.md Starts a Vite development server with hot module replacement for local development of the web UI. Access it at `http://localhost:5173`. ```shell make web-dev-mock ``` -------------------------------- ### Uninstall All Skills Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/skills/package-manager.md Removes all skills installed from all repositories managed by the package manager. This is a comprehensive cleanup operation. ```shell flux-operator skills uninstall --all ``` -------------------------------- ### Configure distribution version Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/api/v1/fluxinstance.md Examples for specifying Flux versions using semver ranges or exact versions. ```yaml spec: distribution: version: "2.8.x" ``` ```yaml spec: distribution: version: "2.8.0" ``` -------------------------------- ### Define FluxInstance Resource Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-migration.md YAML configuration for a FluxInstance resource that mirrors an existing Flux bootstrap setup. ```yaml apiVersion: fluxcd.controlplane.io/v1 kind: FluxInstance metadata: name: flux namespace: flux-system spec: distribution: version: "2.8.x" registry: "ghcr.io/fluxcd" components: - source-controller - source-watcher - kustomize-controller - helm-controller - notification-controller cluster: type: kubernetes multitenant: false networkPolicy: true domain: "cluster.local" sync: kind: GitRepository url: "ssh://git@github.com/my-org/my-fleet.git" ref: "refs/heads/main" path: "clusters/my-cluster" pullSecret: "flux-system" ``` -------------------------------- ### Install Flux Operator with Kubectl Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/operator/operator-install.md Applies the latest release manifest directly to the cluster, primarily for development and testing. ```shell kubectl apply -f https://github.com/controlplaneio-fluxcd/flux-operator/releases/latest/download/install.yaml ``` -------------------------------- ### Create Kubernetes Cluster with Kind Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/config/terraform/README.md Use this command to create a Kubernetes cluster named 'staging' for testing purposes. ```shell kind create cluster --name staging ``` -------------------------------- ### Create Preview Namespace and Service Account Source: https://github.com/controlplaneio-fluxcd/flux-operator/blob/main/docs/guides/resourcesets/rset-feature-branches.md Defines a namespace for preview environments and a service account for Flux with administrative permissions within that namespace. ```yaml apiVersion: v1 kind: Namespace metadata: name: app-preview --- apiVersion: v1 kind: ServiceAccount metadata: name: flux namespace: app-preview --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: flux namespace: app-preview roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: admin subjects: - kind: ServiceAccount name: flux namespace: app-preview ```