agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/harbor-helm/SKILL.md

harbor-helm

Skill4 starsChanged 5 months agoMITView on GitHub

Use when deploying, configuring, or upgrading Harbor on Kubernetes via Helm chart — values configuration, external database, TLS/certificates, storage, ingress, authentication, and production patterns.

  • Reads credentials

The file

Files
SKILL.md

Harbor Helm Chart

Source: https://helm.goharbor.io. Latest chart version: 1.19.1 (app version 2.15.1). Images: all v2.15.1 (core, portal, jobservice, registry, trivy, nginx, log, database, redis, exporter).

Quick Install

helm repo add harbor https://helm.goharbor.io
helm repo update

helm install harbor harbor/harbor \
  --namespace harbor \
  --create-namespace \
  --set expose.tls.auto.commonName=harbor.example.com \
  --set externalURL=https://harbor.example.com \
  --set harborAdminPassword=admin123

Values Overview

Expose / Ingress

ParameterDefaultDescription
expose.typeingressingress, clusterIP, nodePort, loadBalancer
expose.tls.auto.commonName—Auto-generate cert for this hostname
expose.tls.secretName—Use existing TLS secret
expose.tls.certSourceautoauto, secret, none
expose.ingress.hosts.corecore.harbor.domainCore ingress host
expose.ingress.hosts.notarynotary.harbor.domainNotary ingress host
expose.ingress.className—Ingress class name
expose.ingress.annotations{}Ingress annotations

External URL

ParameterDefaultDescription
externalURLhttps://core.harbor.domainFull URL users access Harbor at

Auth

ParameterDefaultDescription
harborAdminPasswordHarbor12345Initial admin password
database.internaltrueUse internal PostgreSQL
database.typepostgresqlpostgresql or external

External Database

database:
  type: external
  external:
    host: postgres.example.com
    port: 5432
    username: harbor
    password: secret
    database: harbor
    sslmode: require
    maxIdleConns: 100
    maxOpenConns: 900

External Redis

redis:
  type: external
  external:
    addr: redis.example.com:6379
    password: secret
    sentinelMaster: mymaster  # if using sentinel

Storage

ComponentDefault PVCParameter
Registry200Gipersistence.persistentVolumeClaim.registry.size
Jobservice1Gipersistence.persistentVolumeClaim.jobservice.size
Database1Gipersistence.persistentVolumeClaim.database.size
Redis1Gipersistence.persistentVolumeClaim.redis.size
Trivy5Gipersistence.persistentVolumeClaim.trivy.size

Object storage (S3-compatible) for registry:

persistence:
  imageChartStorage:
    type: s3
    s3:
      region: us-east-1
      bucket: harbor-registry
      accesskey: AKIA...
      secretkey: ...
      rootdirectory: /registry

Trivy Scanner

ParameterDefaultDescription
trivy.enabledtrueEnable Trivy vulnerability scanner
trivy.image.repositorygoharbor/trivy-adapterScanner image
trivy.image.tagv0.35.1Adapter version (Harbor 2.15.x)
trivy.gitHubToken—GitHub token for Trivy DB download (avoid rate limits)
trivy.skipUpdatefalseSkip Trivy DB update on startup
trivy.offlineScanfalseDisable vulnerability DB updates

Components

ParameterDescription
portal.enabledEnable Harbor web UI (core depends on it)
core.replicasCore API replicas
jobservice.replicasJob service replicas
registry.replicasRegistry replicas
exporter.enabledEnable Prometheus metrics exporter
chartmuseum.enabledEnable Helm Chart Museum
notary.enabledEnable Notary (deprecated, disabled by default)
notary.disabledNotary v1 removed in v2.9+

Production Values Example

expose:
  type: ingress
  tls:
    certSource: secret
    secretName: harbor-tls
  ingress:
    className: cilium
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
    hosts:
      core: harbor.example.com
      notary: notary.example.com

externalURL: https://harbor.example.com

harborAdminPassword: changeme

database:
  type: external
  external:
    host: postgres-cluster-rw.db.svc
    port: 5432
    username: harbor
    password: "${DB_PASSWORD}"
    database: harbor
    sslmode: require
    maxIdleConns: 50
    maxOpenConns: 500

redis:
  type: external
  external:
    addr: redis-cluster.redis.svc:6379
    password: "${REDIS_PASSWORD}"

persistence:
  enabled: true
  resourcePolicy: keep
  imageChartStorage:
    type: s3
    s3:
      region: us-east-1
      bucket: harbor-registry
      accesskey: "${AWS_ACCESS_KEY}"
      secretkey: "${AWS_SECRET_KEY}"
      rootdirectory: /registry
  persistentVolumeClaim:
    registry:
      size: 500Gi
    jobservice:
      size: 10Gi
    trivy:
      size: 20Gi

trivy:
  enabled: true
  gitHubToken: "${GITHUB_TOKEN}"
  replicas: 2

core:
  replicas: 3
  resources:
    requests:
      cpu: 500m
      memory: 1Gi
    limits:
      cpu: 2
      memory: 4Gi

registry:
  replicas: 3
  resources:
    requests:
      cpu: 500m
      memory: 1Gi

jobservice:
  replicas: 2

exporter:
  enabled: true

Upgrading

helm repo update
helm upgrade harbor harbor/harbor \
  --namespace harbor \
  --values values.yaml \
  --version 1.19.1

Migration Path

  • Harbor v2.11.0+ → v2.15.0 directly (via goharbor/prepare Docker image)
  • < v2.11.0 requires sequential upgrades through intermediate versions
  • Must backup ALL data before migration
  • External PostgreSQL must be ≥ v12

Common Mistakes

  • Admin password change — Changing harborAdminPassword after initial deploy does NOT update the password. Change via UI or API.
  • Internal DB in production — Internal PostgreSQL is single-Pod. Use external PostgreSQL with HA for production.
  • Notary v1 deprecated — Disabled since v2.9. Don't enable unless you still need it.
  • Trivy DB download — Without trivy.gitHubToken, Trivy DB downloads are rate-limited to 60 req/hr. Set a GitHub token.
  • S3 region mismatch — Registry S3 bucket and IAM credentials must match the configured region.
  • Exporter credentials — Prometheus exporter uses the same admin credentials. Set exporter.secret for a dedicated monitoring password.
  • Upgrade schema migration — goharbor/prepare must run during upgrade to apply DB schema migrations. The Helm chart handles this automatically.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.