Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Harbor: Enterprise Container Registry on Kubernetes
DevOps

Harbor: Enterprise Container Registry on Kubernetes

Deploy Harbor for vulnerability scanning, image signing, replication, RBAC, and Helm chart hosting β€” the CNCF graduated registry.

LB
Luca Berton
Β· 1 min read

What Is Harbor?

Harbor is an enterprise container registry with vulnerability scanning, image signing, replication, and RBAC. CNCF Graduated, 25K+ GitHub stars.

Harbor vs Docker Hub vs ECR

FeatureHarborDocker HubECR/GCR/ACR
Self-hostedβœ…βŒβŒ
Vulnerability scanningβœ… (Trivy)⚠️ Paidβœ…
Image signingβœ… (Cosign/Notary)❌⚠️
Replicationβœ… (multi-site)❌⚠️ (cross-region)
RBACβœ… Fine-grained⚠️ Basicβœ…
Helm chartsβœ…βŒβš οΈ
Quotasβœ… Per-projectπŸ’°βœ…
Cost$0 + infra$7-25/moPer-GB

Helm Installation

helm repo add harbor https://helm.goharbor.io
helm install harbor harbor/harbor \
  --namespace harbor \
  --create-namespace \
  --set expose.type=ingress \
  --set expose.ingress.hosts.core=registry.yourdomain.com \
  --set expose.tls.certSource=secret \
  --set persistence.persistentVolumeClaim.registry.size=500Gi \
  --set persistence.persistentVolumeClaim.database.size=50Gi \
  --set harborAdminPassword=your-secure-password \
  --set trivy.enabled=true

Key Features

Automatic Vulnerability Scanning

Every pushed image is scanned with Trivy:

# Push triggers automatic scan
docker push registry.yourdomain.com/myproject/api:v1.2.3

# Harbor blocks pull if critical CVEs found (configurable)
# Policy: prevent deployment of images with Critical/High CVEs

Image Signing (Supply Chain Security)

# Sign with Cosign
cosign sign --key cosign.key registry.yourdomain.com/myproject/api:v1.2.3

# Kubernetes admission controller verifies signatures
# Only signed images can run in production namespaces

Replication (Multi-Site)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Harbor EU   │◀──sync──▢│  Harbor US   β”‚
β”‚  (primary)   β”‚         β”‚  (replica)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”‚  push from CI/CD
       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚  Developers β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Images replicated across regions for HA and faster pulls.

Garbage Collection

# Schedule GC to reclaim storage from deleted tags
# Harbor Admin β†’ Configuration β†’ Garbage Collection β†’ Schedule
# Recommended: weekly, during low-traffic hours

Integration with Kubernetes

# ImagePullSecret for Harbor
apiVersion: v1
kind: Secret
metadata:
  name: harbor-registry
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: <base64-encoded-config>
---
# Pod spec
spec:
  imagePullSecrets:
    - name: harbor-registry
  containers:
    - name: app
      image: registry.yourdomain.com/production/api:v1.2.3

Storage Sizing

ImagesTags/ImageAvg SizeTotal Storage
5010500MB250GB
20020500MB2TB
500301GB15TB

Enable layer deduplication β€” reduces actual storage by 40-60%.

#Kubernetes #Security #DevOps
Share:
Cloud Infrastructure Design

Need help with Cloud Infrastructure Design?

Build resilient, cost-effective cloud environments with expert architecture consulting.

Learn more about Cloud Infrastructure Design

Want to operate this yourself, in production?

Take the free AI Platform Engineer Readiness Scorecard to see which skills transfer β€” then build a production-shaped AI platform in the 4-week Bootcamp.

Take the Scorecard β†’
Luca Berton β€” AI & Cloud Advisor, Docker Captain

Luca Berton

AI & Cloud Advisor Β· Docker Captain Β· KubeCon Speaker

15+ years in enterprise infrastructure. Author of 8 technical books, creator of Ansible Pilot (1M+ YouTube views, 648K site users). Former Red Hat engineer. Speaker at KubeCon EU 2026 and Red Hat Summit 2026.

Free 30-min AI & Cloud consultation

Book Now