- Package Kubernetes manifests into an OCI artifact
- Sign the artifact with Cosign
- Configure Flux to verify signatures on pull
- Flux v0.35+ installed and configured
dockerandkubectlCLI tools available- Access to a container registry (e.g., GitHub Container Registry)
1. Package and Push Manifests as an OCI Artifact
Assume your repository has Nginx manifests structured like this:2. Install Cosign and Generate a Key Pair
Download the latest Cosign release and make it executable:Store your
cosign.key in a secure vault. Loss or compromise of the private key may allow unauthorized signatures.3. Sign the OCI Artifact
Use your private key to sign the pushed artifact:4. Verify the Artifact Manually
Confirm the signature before deploying:5. Store the Public Key in Kubernetes
Flux verifies signatures by reading your public key from a Kubernetes Secret:6. Configure Flux to Verify OCI Artifacts
Create anOCIRepository resource that enforces signature verification:
- Fetch the OCI layer
- Verify the signature against the supplied public key
- Abort on failure or extract the tarball on success