Controller Options

Controller command flags and defaults.

To customise the controller options at install time, please see the bootstrap customization guide.

Source controller flags

NameTypeDescription
--artifact-retention-recordsintThe maximum number of artifacts to be kept in storage after a garbage collection. (default 2)
--artifact-retention-ttldurationThe duration of time that artifacts from previous reconciliations will be kept in storage before being garbage collected. (default 1m0s)
--authorized-artifact-client-spiffe-idstringsSPIFFE ID authorized to fetch artifacts from the artifact server. Can be repeated. When set, the artifact server uses SPIFFE mTLS.
--authorized-event-server-spiffe-idstringsSPIFFE ID of an event server authorized to receive events from source-controller. Can be repeated. When set, the event recorder uses SPIFFE mTLS.
--concurrentintThe number of concurrent reconciles per controller. (default 2)
--default-service-accountstringDefault service account to use for workload identity when not specified in resources.
--enable-leader-electionbooleanEnable leader election for controller manager. Enabling this will ensure there is only one active controller manager.
--events-addrstringThe address of the events receiver.
--health-addrstringThe address the health endpoint binds to. (default “:9440”)
--helm-cache-max-sizeintThe maximum size of the cache in number of indexes.
--helm-cache-purge-intervalstringThe interval at which the cache is purged. Valid time units are ms, s, m. (default “1m”)
--helm-cache-ttlstringThe TTL of an index in the cache. Valid time units are ms, s, m. (default “15m”)
--helm-chart-file-max-sizeintThe max allowed size in bytes of a file in a Helm chart. (default 5242880)
--helm-chart-max-sizeintThe max allowed size in bytes of a Helm chart file. (default 10485760)
--helm-index-max-sizeintThe max allowed size in bytes of a Helm repository index file. (default 52428800)
--interval-jitter-percentageuint8Percentage of jitter to apply to interval durations. A value of 10 will apply a jitter of +/-10% to the interval duration. It cannot be negative, and must be less than 100. (default 5)
--leader-election-lease-durationdurationInterval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)
--leader-election-release-on-cancelbooleanDefines if the leader should step down voluntarily on controller manager shutdown. (default true)
--leader-election-renew-deadlinedurationDuration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)
--leader-election-retry-perioddurationDuration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)
--log-encodingstringLog encoding format. Can be ‘json’ or ‘console’. (default “json”)
--log-levelstringLog verbosity level. Can be one of ’trace’, ‘debug’, ‘info’, ’error’. (default “info”)
--max-retry-delaydurationThe maximum amount of time for which an object being reconciled will have to wait before a retry. (default 15m0s)
--metrics-addrstringThe address the metric endpoint binds to. (default “:8080”)
--min-retry-delaydurationThe minimum amount of time for which an object being reconciled will have to wait before a retry. (default 750ms)
--requeue-dependencydurationThe interval at which failing dependencies are reevaluated. (default 30s)
--ssh-hostkey-algosstringsThe list of hostkey algorithms to use for ssh connections, arranged from most preferred to the least.
--ssh-kex-algosstringsThe list of key exchange algorithms to use for ssh connections, arranged from most preferred to the least.
--storage-addrstringThe address the static file server binds to. (default “:9090”)
--storage-adv-addrstringThe advertised address of the static file server.
--storage-pathstringThe local storage path.
--token-cache-max-sizeintThe maximum amount of entries in the LRU cache used for tokens. (default 100, enabled)
--spiffe-broker-endpointstringThe gRPC URL of the SPIFFE Broker endpoint.
--spiffe-broker-idstringsSPIFFE ID of the SPIFFE Broker endpoint. Can be repeated.
--token-cache-max-durationdurationThe maximum duration for which a token would be considered unexpired. This is capped at 1h. (default 1h)
--watch-all-namespacesbooleanWatch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)
--watch-label-selectorstringWatch for resources with matching labels e.g. ‘sharding.fluxcd.io/key=shard1’.
--feature-gatesmapStringBoolA comma separated list of key=value pairs defining the state of experimental features.

SPIFFE mTLS

When at least one of the repeatable flags --authorized-artifact-client-spiffe-id or --authorized-event-server-spiffe-id is set, source-controller acquires an X.509-SVID from the SPIFFE Workload API. The SPIFFE_ENDPOINT_SOCKET environment variable must point to the Workload API socket.

  • --authorized-artifact-client-spiffe-id authorizes the given SPIFFE IDs to fetch artifacts from the artifact server. When set, the artifact server uses mTLS.
  • --authorized-event-server-spiffe-id authorizes the given SPIFFE IDs of event servers to which source-controller sends events. When set, the event recorder uses mTLS.

Each traffic type is protected independently. SPIFFE mTLS is transparent to the Flux API: the scheme of .status.artifact.url does not change.

Each flag value is interpreted as follows:

  • spiffe://<trust domain>/<path> authorizes exactly that SPIFFE ID.
  • spiffe://<trust domain>/<path>/ (with a trailing slash) authorizes any SPIFFE ID with that path prefix.
  • spiffe://<trust domain> (without a path) authorizes any SPIFFE ID in that trust domain.

Whenever <trust domain> equals the special value self, source-controller understands it as the trust domain of the controller’s own X509-SVID.

Invalid values cause source-controller to fail at startup.

SPIFFE Broker API

When --spiffe-broker-endpoint and at least one --spiffe-broker-id are set, source-controller acquires an X.509-SVID from the SPIFFE Workload API and uses it to authenticate to the SPIFFE Broker API. The SPIFFE_ENDPOINT_SOCKET environment variable must point to the Workload API socket.

The Broker is used to acquire JWT-SVIDs for object identity when a ServiceAccount sets credential.auth.fluxcd.io/provider to spiffe. The Broker endpoint is a TCP gRPC target, e.g. dns:///spire-server.spire.svc.cluster.local:8443.

Each --spiffe-broker-id value is interpreted like the SPIFFE IDs used by the mTLS flags. Invalid values cause source-controller to fail at startup.

Feature Gates

NameDefault ValueDescription
CacheSecretsAndConfigMapsfalseConfigures the caching of Secrets and ConfigMaps by the controller-runtime client. When enabled, it will cache both object types, resulting in increased memory usage and cluster-wide RBAC permissions (list and watch).
OptimizedGitClonestrueOptimises Git resource usage by only cloning repositories when the HEAD commit changed since last reconciliation.

Source watcher flags

NameTypeDescription
--artifact-digest-algostringThe hashing algorithm used to calculate the digest of artifacts. (default “sha256”)
--artifact-retention-recordsintThe maximum number of artifacts to be kept in storage after a garbage collection. (default 2)
--artifact-retention-ttldurationThe duration of time that artifacts from previous reconciliations will be kept in storage before being garbage collected. (default 1m0s)
--authorized-artifact-client-spiffe-idstringsSPIFFE ID authorized to fetch artifacts from the artifact server. Can be repeated. When set, the artifact server uses SPIFFE mTLS.
--authorized-artifact-server-spiffe-idstringsSPIFFE ID of an artifact server authorized to serve artifacts to source-watcher. Can be repeated. When set, the artifact fetcher uses SPIFFE mTLS.
--authorized-event-server-spiffe-idstringsSPIFFE ID of an event server authorized to receive events from source-watcher. Can be repeated. When set, the event recorder uses SPIFFE mTLS.
--concurrentintThe number of concurrent reconciles per controller. (default 10)
--default-service-accountstringThe default service account used to authorize cross-namespace artifacts and managed namespaces when .spec.serviceAccountName is not specified.
--enable-leader-electionbooleanEnable leader election for controller manager. Enabling this will ensure there is only one active controller manager.
--events-addrstringThe address of the events receiver.
--health-addrstringThe address the health endpoint binds to. (default “:9440”)
--http-retryintThe maximum number of retries when failing to fetch artifacts over HTTP. (default 9)
--interval-jitter-percentageuint8Percentage of jitter to apply to interval durations. A value of 10 will apply a jitter of +/-10% to the interval duration. It cannot be negative, and must be less than 100. (default 5)
--leader-election-lease-durationdurationInterval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)
--leader-election-release-on-cancelbooleanDefines if the leader should step down voluntarily on controller manager shutdown. (default true)
--leader-election-renew-deadlinedurationDuration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)
--leader-election-retry-perioddurationDuration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)
--log-encodingstringLog encoding format. Can be ‘json’ or ‘console’. (default “json”)
--log-levelstringLog verbosity level. Can be one of ’trace’, ‘debug’, ‘info’, ’error’. (default “info”)
--max-retry-delaydurationThe maximum amount of time for which an object being reconciled will have to wait before a retry. (default 15m0s)
--metrics-addrstringThe address the metric endpoint binds to. (default “:8080”)
--min-retry-delaydurationThe minimum amount of time for which an object being reconciled will have to wait before a retry. (default 750ms)
--no-cross-namespace-refsbooleanWhen set to true, references between custom resources are allowed only if the reference and the referee are in the same namespace. (default false)
--override-managerstringArrayField manager disallowed to perform changes on managed resources. Can be repeated.
--reconciliation-timeoutdurationThe maximum duration of a reconciliation. (default 10m0s)
--requeue-dependencydurationThe interval at which failing dependencies are reevaluated. (default 5s)
--storage-addrstringThe address the static file server binds to. (default “:9090”)
--storage-adv-addrstringThe advertised address of the static file server.
--storage-pathstringThe local storage path. (default “/data”)
--watch-all-namespacesbooleanWatch for resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)
--watch-label-selectorstringWatch for resources with matching labels e.g. ‘sharding.fluxcd.io/shard=shard1’.
--feature-gatesmapStringBoolA comma separated list of key=value pairs defining the state of experimental features.

SPIFFE mTLS

When at least one of the repeatable flags --authorized-artifact-client-spiffe-id, --authorized-artifact-server-spiffe-id or --authorized-event-server-spiffe-id is set, source-watcher acquires an X.509-SVID from the SPIFFE Workload API. The SPIFFE_ENDPOINT_SOCKET environment variable must point to the Workload API socket.

  • --authorized-artifact-client-spiffe-id authorizes the given SPIFFE IDs to fetch artifacts from the artifact server. When set, the artifact server uses mTLS.
  • --authorized-artifact-server-spiffe-id authorizes the given SPIFFE IDs of artifact servers from which source-watcher fetches artifacts. When set, the artifact fetcher uses mTLS.
  • --authorized-event-server-spiffe-id authorizes the given SPIFFE IDs of event servers to which source-watcher sends events. When set, the event recorder uses mTLS.

Each traffic type is protected independently. SPIFFE mTLS is transparent to the Flux API: the scheme of .status.artifact.url does not change.

Each flag value is interpreted as follows:

  • spiffe://<trust domain>/<path> authorizes exactly that SPIFFE ID.
  • spiffe://<trust domain>/<path>/ (with a trailing slash) authorizes any SPIFFE ID with that path prefix.
  • spiffe://<trust domain> (without a path) authorizes any SPIFFE ID in that trust domain.

Whenever <trust domain> equals the special value self, source-watcher understands it as the trust domain of the controller’s own X509-SVID.

Invalid values cause source-watcher to fail at startup.

Feature Gates

NameDefault ValueDescription
DirectSourceFetchfalseEnables fetching source objects (GitRepository, OCIRepository, Bucket, HelmChart, ExternalArtifact) directly from the API server using APIReader, bypassing the controller’s cache. This can be useful when immediate consistency is required for source object reads.
Last modified 2026-06-29: Import controller options (0f12aeb1)