-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
area/generatorArtifact generation related issues and pull requestsArtifact generation related issues and pull requestsenhancementNew feature or requestNew feature or request
Description
Flux sources such as GitRepos and Buckets can contain manifests packaged with flux build artifact or with helm package. To allow the reconciliation of such manifests, we should implement a copy strategy that extracts the contents of the archive into the destination artifact. The implementation should use fluxcd/pkg/tar.Untar.
Example
Assuming that in CI we run the following:
flux build artifact --path ./manifests/ -o manifests.tgz
aws s3 cp manifests.tgz s3://my-fleet/clusters/prod-1/manifests.tgzWe can define a generator that extracts the manifests from the tarball and places them in the root of the generated artifact:
apiVersion: source.extensions.fluxcd.io/v1beta1
kind: ArtifactGenerator
metadata:
name: cluster-config-unpack
namespace: flux-system
spec:
sources:
- alias: bucket
kind: Bucket
name: fleet
artifacts:
- name: cluster-config
originRevision: "@bucket"
copy:
- from: "@bucket/clusters/prod-1/manifests.tgz"
to: "@artifact/"
strategy: ExtractTo reconcile the manifests with a Flux Kustomization:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-sync
namespace: flux-system
spec:
interval: 15m
sourceRef:
kind: ExternalArtifact
name: cluster-config
path: "./"
prune: truematheuscscp
Metadata
Metadata
Assignees
Labels
area/generatorArtifact generation related issues and pull requestsArtifact generation related issues and pull requestsenhancementNew feature or requestNew feature or request