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.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A running Kubernetes cluster with Flux installed in the
flux-systemnamespace - 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 FluxSecret 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 anOCIRepository source.
3. Apply Manifests with Kustomization
Once theOCIRepository 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 aHelmRelease to instruct Flux’s Helm Controller to fetch and install the chart.
Comparison of OCI vs. Helm Sources
| Resource Type | Controller | Use Case |
|---|---|---|
| OCIRepository | Source Controller | Static YAML, images, configs |
| Kustomization | Kustomize Controller | Apply kustomized manifests |
| HelmRepository | Source Controller | OCI-packaged Helm charts |
| HelmRelease | Helm Controller | Automated Helm chart deployment |
Links and References
- Flux CD Documentation
- OCI Artifacts Specification
- Kustomize Controller
- Helm Controller
- GitHub Container Registry