KubernetesCXV · Image Registry OperationsImage registry operations
Private registries — Harbor, Quay, and on-prem control
What you'll learn
- Use Harbor for a private container registry
- Configure pull-through cache and replication
- Apply vulnerability scanning and image signing
- Apply the operational discipline of private registry management
Prerequisites
Verified against Kubernetes 1.34.x · kubeadm 1.34.x · kubectl 1.34.x · etcd 3.6.x · CoreDNS 1.11.x · containerd 1.7.x / 2.x · 2026-08-16
Private container registries provide on-prem control of images, vulnerability scanning, signing, and replication. This lesson walks Harbor, Quay, distribution, and the discipline.
Harbor
flowchart LR
A[Harbor] --> B["Image storage: S3 / Azure Blob / GCS"]
A --> C["Vulnerability scanner: Trivy"]
A --> D["Image signing: cosign"]
A --> E[Replication rules]
A --> F[Pull-through cache]
G[Kubernetes cluster] -->|pull| A
Harbor’s components:
- Image storage. Pluggable; S3, Azure Blob, GCS, local filesystem.
- Vulnerability scanner. Trivy (default), Clair, Anchore.
- Image signing. cosign (Sigstore) integration.
- Replication rules. Replicate images to other registries.
- Pull-through cache. Cache images from upstream (Docker Hub, cloud registries).
Harbor is CNCF Graduated; it is the standard for production on-prem registries.
A project in Harbor
# Create a project
harbor-cli project create \
--name prod-app \
--public false \
--storage-quota 100GB
# Add a user as project admin
harbor-cli user create \
--username ci-bot \
--password *** \
--email ci@example.com
harbor-cli project-member create \
--project prod-app \
--user ci-bot \
--role project-admin
The project:
- Storage quota. Limits the project’s storage.
- Public/private. Private by default.
- Members. Users with project-level roles.
The CI/CD pipeline pushes images to the project using the CI bot’s credentials.
Vulnerability scanning
flowchart LR
A[Image pushed] --> B["Harbor: trigger scan"]
B --> C["Trivy: scan layers"]
C --> D{Vulnerabilities found?}
D -->|Yes| E["Report: critical, high, medium, low"]
D -->|No| F[Mark as clean]
E --> G[Block deployment if critical]
F --> H[Allow deployment]
Harbor scans every pushed image. The scan produces a vulnerability report (CVE counts by severity).
Policies can block deployment of images with critical vulnerabilities. CI/CD pipelines fail; the team must remediate.
Image signing with cosign
# Sign an image after pushing
cosign sign --key cosign.key registry.example.com/prod-app/myapp:1.2.3
# Verify a signature
cosign verify --key cosign.pub registry.example.com/prod-app/myapp:1.2.3
cosign integration:
- Sign. After pushing, cosign signs the image.
- Verify. Before deploying, cosign verifies the signature.
Harbor stores the signature alongside the image. Kubernetes can verify via Kyverno or Connaisseur.
Replication
# Create a replication rule
harbor-cli replication create \
--name prod-to-dr \
--source-registry local \
--destination-registry dr-harbor \
--trigger manual \
--projects prod-app
Replication rules:
- Source. The local Harbor registry.
- Destination. A remote Harbor (DR site, another cluster).
- Trigger. Manual, scheduled, or event-based.
- Projects. Which projects to replicate.
Replication provides DR (the DR registry has the images) and multi-cluster (multiple clusters pull from the closest registry).
Quay and distribution
| Feature | Harbor | Quay | distribution |
|---|---|---|---|
| Pull-through cache | yes | yes | yes |
| Vulnerability scanning | Trivy | Clair | no |
| Image signing | cosign | cosign, Notary | no |
| Replication | yes | yes | no |
| RBAC | yes | yes | basic |
| UI | yes | yes | no |
Harbor and Quay are both production-ready. Harbor is more popular (CNCF Graduated). distribution is minimal (no scanning, no UI); use it for simple registries.
Quiz
Knowledge check · 4 questions
Q1. What does a pull-through cache registry provide beyond faster pulls?
Q2. A pull-through cache protects against upstream registry rate limits.
Q3. Restore a Harbor replication rule that has been failing silently, and verify the disaster-recovery registry is usable.
A DR exercise finds the standby registry short of images. In Harbor, the `prod-to-dr` replication rule's last successful execution was 11 days ago; every execution since has failed with `unauthorized: unauthorized to access repository`. The primary's `prod-app` project holds 51 repositories against the DR project's 34, and the robot account used by the destination endpoint expired on the day the failures began.
Q4. Which Harbor project setting prevents a Pod ever pulling an image with an unresolved critical vulnerability, and which component produces the finding?
Passing score: 75%. Answers are checked in this browser.
The operational discipline
Private registries in production rest on five non-negotiable elements:
- Harbor for on-prem production. CNCF Graduated; full-featured.
- Enable vulnerability scanning. Block critical vulnerabilities.
- Sign images with cosign. Verify before deployment.
- Replicate to DR. Multi-cluster and DR.
- Back up the registry. Images, signatures, scan reports.
Private registries are the source of application code. The discipline is enable scanning, sign images, and replicate for DR.