Skip to main content
In this lesson we’ll package plain Kubernetes manifests as OCI artifacts and push them to an OCI-compliant registry so Flux can later pull and deploy them. We use GitHub Container Registry (GHCR, part of GitHub Packages) as the remote OCI registry for the demo. Before you begin, you’ll need a GitHub Personal Access Token (PAT) with package-related scopes (read and write for packages; delete is optional). If you already created a PAT during Flux installation you can reuse it, or create/edit a new classic token. Store the token securely — GitHub shows it only once.
A screenshot of the GitHub Personal Access Token settings page showing a token named "flux-demo" with selected scopes like repo, write:packages, and delete:packages. The page notes the token has no expiration date and displays multiple checkbox options for OAuth scopes.
Ensure you save the PAT when you create it. GitHub will not show it again after you leave the creation page.
For private GHCR packages, the PAT must include package read and write permissions. Grant the least privileges required and rotate tokens regularly.

Repo layout and local setup

  • Manifests used in this demo live in the Git branch 7-demo under 7.7.0/manifests.
  • If you encounter a Git “dubious ownership” error while switching branches on a VM (common when running as root), add the repository to Git’s safe list:
  • To inspect the directory tree (install tree if missing):

Authenticate to GHCR

Flux’s push artifact command relies on Docker credentials stored in ~/.docker/config.json (created by docker login). Authenticate using your GitHub username and the PAT as the password. Interactive login:
Non-interactive (recommended for CI):
After login, ~/.docker/config.json contains the credentials that Flux will use to push artifacts.

Push manifests as an OCI artifact with Flux

Use flux push artifact to package a directory (or a single file) into a tarball and publish it to an OCI repository. In this example we push the 7.7.0/manifests directory to GHCR, tag the artifact with 7.7.0-<short-git-sha>, and record the Git source and revision metadata. Example command:
Tip: capture the digest (artifact reference with sha256) for future use:
Sample successful output (digest will differ):

Flags and metadata explained

Optional: sign the artifact with cosign for provenance and verification. See Cosign docs for signing and verification workflows.

Verify the package on GitHub

Refresh your repository’s Packages page on GitHub after the push. The package should appear (often marked private). The pulling client (Flux or Docker) must authenticate to GHCR with a token that has package read access.
A GitHub user profile page with a large circular avatar showing a smiling man. The page's Packages tab is open, listing one private package named "bb-app."
You can also pull the artifact manually with Docker (authentication required for private packages):

Next steps

That’s all for this lesson — you’ve packaged Kubernetes manifests as an OCI artifact and pushed them to GHCR so Flux can later fetch and apply them.

Watch Video