Verify Cosign Is Not Installed
First, confirm Cosign isn’t already available:Seeing
command not found means Cosign isn’t installed. Continue to the installation methods below.Installation Options
Cosign is part of the Sigstore project. Choose the method that best fits your environment:| Method | Use Case | Example Command |
|---|---|---|
| Standalone Binary | Quick install on Linux | Download, move to PATH, set executable |
| RPM Package | RPM-based Linux distros | sudo rpm -Uvh cosign-*.rpm |
| DEB Package | Debian/Ubuntu systems | sudo dpkg -i cosign_*.deb |
1. Standalone Binary
2. RPM Package
3. DEB Package
Verify Installation
After installation, check your Cosign version:Ensure you install v2.0.0 or later for full compatibility with Flux CD’s image verification features.
Generate a Cosign Key Pair
Create an asymmetric key pair to sign your OCI artifacts:Keep your private key (
cosign.key) secure and never commit it to version control. Remember your password—it’s required for signing and verification.Configure Flux CD with the Public Key
To enable Flux CD to verify image signatures, store the public key as a Kubernetes Secret in theflux-system namespace:
Next Steps
- Build and push an OCI artifact (e.g., container image).
- Sign the image using Cosign.
- Observe Flux CD verifying the signature in your cluster.