Skip to main content
In this guide, we’ll show you how to use the Flux Source Controller to fetch resources from an OCI artifacts repository. This approach works with any compliant OCI registry—such as GitHub Container Registry (GHCR), Docker Hub, or cloud‐hosted registries—by leveraging the OCI Artifacts API.

Prerequisites

  • A running Kubernetes cluster with Flux installed in the flux-system namespace
  • An OCI registry account (e.g., GitHub Container Registry)
  • A personal access token (PAT) or registry credentials with pull permissions

1. Create the OCI Secret

First, store your registry credentials in a Flux Secret of type OCI. This will allow Flux to authenticate when fetching artifacts.
Do not commit your <GitHub-Personal-Access-Token> or any credentials into your Git repository. Treat them as sensitive data.

2. Register the OCI Repository as a Source

Point Flux to your OCI‐hosted image or artifact by creating an OCIRepository source.

3. Apply Manifests with Kustomization

Once the OCIRepository is ready, deploy its manifests into your cluster via a Kustomization.
Set --prune=false if you want to retain orphaned resources. Adjust --interval to control reconciliation frequency.

4. Fetching OCI-Hosted Helm Charts

Flux’s Kustomize Controller cannot process Helm charts directly. To deploy charts stored in an OCI registry, register the same registry as a Helm source.

4.1 Register the Helm Repository

4.2 Deploy the Helm Chart

Create a HelmRelease to instruct Flux’s Helm Controller to fetch and install the chart.
This will trigger the Helm Controller to pull chart artifacts from your OCI registry and perform automated releases.

Comparison of OCI vs. Helm Sources


Watch Video