Ansible Role: flux

This role installs and configures FluxCD in a Kubernetes cluster.

It uses the Flux Operator to deploy a FluxInstance to the Kubernetes cluster, which in turn is configured to watch a GitLab repository for changes to a set of Kubernetes manifests.

Usage

  • The host to which this role is applied should have a valid kubeconfig file with cluster admin permissions. You can set the KUBECONFIG environment variable to point to the kubeconfig file on the target host.

  • When this role is first applied to a cluster, it will auto-generate a private key for the FluxInstance to pull from the GitLab repository. Watch the command-line output for instructions on how to add the corresponding public key as a GitLab Deploy Key.

Variables

Variable

Required

Description

flux_cli_version

No

Version of the flux CLI installed on the target host.

flux_namespace

No

Kubernetes namespace to which the Flux operator and instance are deployed.

flux_operator_chart

No

URL of the Flux operator Helm chart.

flux_operator_version

No

Version of the Flux operator Helm chart.

flux_instance_cluster_domain

No

The Kubernetes cluster domain of the target cluster.

flux_instance_repo_url

No

URL to the GitLab repository containing the Flux manifests.

flux_instance_repo_ref

No

Reference of the GitLab repository to use.

flux_instance_repo_path

Yes

Relative path in the GitLab repository pointing to the Flux manifests.

flux_instance_version

No

The Flux distribution version used by the FluxInstance.