LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

flux-export

Export Flux resources as YAML

TLDR

Export a Kustomization
$ flux export kustomization podinfo
copy
Export every Kustomization in the namespace to a file
$ flux export kustomization --all > kustomizations.yaml
copy
Export a GitRepository including its credential Secret
$ flux export source git my-private-repo --with-credentials
copy
Export every GitRepository source
$ flux export source git --all
copy
Export a HelmRelease
$ flux export helmrelease podinfo
copy

SYNOPSIS

flux export kind [name] [options]

DESCRIPTION

flux export prints one or all Flux custom resources in a namespace as YAML on stdout. A name is required unless --all is set.Use it to capture live objects for a Git repository, to move them between clusters, or to inspect the spec Flux is reconciling. Credential Secrets are omitted unless --with-credentials is passed on a source that stores them.Short kind aliases such as `ks` for kustomization and `hr` for helmrelease are accepted.

PARAMETERS

--all

Select every resource of the given kind in the namespace.
--with-credentials
Include credential Secrets when exporting a source (SSH key pair or basic auth).
-n, --namespace ns
Namespace scope for the CLI request (default `flux-system`).
--timeout duration
Timeout for the operation (default `5m0s`).
--kubeconfig file
Path to the kubeconfig file.
--context name
Kubeconfig context to use.

KINDS

kustomization

Export a Kustomization.
helmrelease
Export a HelmRelease.
source git, source helm, source oci, source bucket, source chart, source external
Export a GitRepository, HelmRepository, OCIRepository, Bucket, HelmChart, or ExternalArtifact.
image policy, image repository, image update
Export ImagePolicy, ImageRepository, or ImageUpdateAutomation objects.
alert, alert-provider, receiver
Export notification Alerts, Providers, and Receivers.
artifact
Export artifact objects, including artifact generators.

INSTALL

sudo apk add flux
copy
brew install flux
copy
nix profile install nixpkgs#flux
copy

CAVEATS

--with-credentials writes private keys and passwords to stdout. Redirect that output only to a protected file. Exported YAML is the live object, which can differ from the manifest stored in Git. Cluster access via kubectl is required.

SEE ALSO

RESOURCES

Copied to clipboard
Kai