Replies: 2 comments 9 replies
-
As an example the tekton project uses OCI artifacts to store |
Beta Was this translation helpful? Give feedback.
-
Use a disjoint type proposalI propose we add a command to Flux CLI that bundles a directory containing Kubernetes manifests and/or Kustomize overlays, pushes the artifact to an OCI registry (using the local docker config) and optinally signs the artifact with a sigstore key. Example command: flux bundle -f ./deploy -t ghcr.io/stefanprodan/podinfo-deploy:v1.0.0 -s cosig.key As for the API, I opt for Example of a source that pulls a fixed version from the OCI registry and verifies its authenticity using sigstore: apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: ArtifactRepository
metadata:
name: podinfo-release
namespace: flux-system
spec:
interval: 10m
image: ghcr.io/stefanprodan/podinfo-deploy
secretRef:
name: regcred
tag: "1.0.0"
verify:
secretRef:
name: sigstore-keys Example of a source that pulls the latest tag based on timestamp ordering: apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: ArtifactRepository
metadata:
name: podinfo-nighlty-builds
namespace: flux-system
spec:
interval: 10m
image: ghcr.io/stefanprodan/podinfo-deploy
secretRef:
name: regcred
filterTags:
pattern: '^main-[a-fA-F0-9]+-(?P<ts>.*)'
extract: '$ts'
policy:
numerical:
order: asc Example of a source that pulls the latest tag based on semver ordering: apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: ArtifactRepository
metadata:
name: podinfo-release-candidates
namespace: flux-system
spec:
interval: 10m
image: ghcr.io/stefanprodan/podinfo-deploy
secretRef:
name: regcred
filterTags:
pattern: '.*-rc.*'
policy:
semver:
range: '^1.x-0' |
Beta Was this translation helpful? Give feedback.
-
It's been suggested several times, in different places, to make OCI artifacts* available as a source. A few things recommend using OCI:
*What is an OCI artifact as opposed to an OCI image? An OCI image is the standardised form of a Docker image, that is something you can run. An artifact is the more general specification, which shares the manifest, index and layer bits of OCI images, but you can define your own format. This article does a good job of explaining what artifacts are: https://dlorenc.medium.com/oci-artifacts-explained-8f4a77945c13
Related issues and discussions:
Design and implementation notes:
Handling different media types
OCI artifacts come in different formats -- it's not just runnable container images any more, and not just an overlay filesystem in tarballs. In general, formats will not be suitable for distributing Kubernetes configuration; and, each format will have its own layout of files in layers. So I would expect an implementation to handle specific media types, rather than try to be generic across media types.
A particular case is Helm charts in OCI artifacts: these are suitable for consumption by the helm-controller, and not by anything else. But, in the spirit of remaining duck-typed, it's OK to let people mix and match as they wish.
Relation to image.toolkit.fluxcd.io API
The image.toolkit.fluxcd.io API has these types:
These stand alone, but there is clear overlap in the arrangement of ImageRepository and ImagePolicy, and what an OCI source would do. There are some alternatives for how to account for this:
useAsSource
, which is understood by a separate controller (source-controller or another); or, something to switch it on for some subset of ImagePolicy types, from outside, e.g., by namespace.Beta Was this translation helpful? Give feedback.
All reactions