harbor

by devXY GmbH

Helm chartv2.4.0App 2.16.0Verified publisher

An open source trusted cloud native registry that stores, signs, and scans content

About this chart

harbor

Installation

OCI:

helm install harbor oci://codefloe.com/devxy/harbor

Classic Helm:

helm repo add codefloe.com https://codefloe.com/api/packages/devxy/helm
helm install harbor codefloe.com/harbor

Changes compared to official Harbor helm chart

  • Refactored all secret references from using ConfigMaps to secret env vars
  • All Redis-related config options can be provided in a single secret via redis.external.existingSecret
  • Uses the most stable release of Harbor instead of dev
  • Default service accounts has RBAC permissions to read k8s secrets
  • Fixed existingSecret handling to work properly without pre-existing secrets (uses RBAC and init containers)

Configure OIDC auth

Must be done by passing an env var named CONFIG_OVERWRITE_JSON which contains all OIDC settings. It is recommended to use a secret for this value.

core:
  extraEnvVars:
    - name: CONFIG_OVERWRITE_JSON
      valueFrom:
        secretKeyRef:
          name: config-overwrite-json
          key: CONFIG_OVERWRITE_JSON

High Availability

To deploy Harbor in high availability mode, the following components are required:

  • An external HA-enabled PostgreSQL DB (personal recommendation: Crunchy Postgres Operator)
  • An external Redis/Valkey deployment
  • A HA-capable storage backend for images & charts (either a RWX (for filesystem storage) or a external backend like S3)
  • RWX-backed PVCs for the individual pods (core, registry, jobservice, trivy)

[!NOTE] As of v 2.13, Harbor does not support Redis/Valkey cluster. The only option is to use Redis/Valkey sentinal or live with a single-instance deployment for this component.

Below is an example configuration for a HA deployment (showing only the essential HA components):

portal:
  replicas: 2
registry:
  replicas: 2
jobservice:
  replicas: 2
core:
  replicas: 2
trivy:
  replicas: 2

database:
  type: external
  external:
    host: '<host>'
    port: '5432'
    username: '<username>'
    coreDatabase: '<database>'
    existingSecret: '<secret>'
    sslmode: 'require'

persistence:
  persistentVolumeClaim:
    registry:
      storageClass: <storageClass>
      accessMode: ReadWriteMany
    jobservice:
      jobLog:
        storageClass: <storageClass>
        accessMode: ReadWriteMany
    trivy:
      storageClass: <storageClass>
      accessMode: ReadWriteMany

  imageChartStorage:
    type: s3
    delete:
      enabled: true
    cache:
      blobdescriptor: redis
    s3:
      existingSecret: '<s3-credentials>'
      region: <region>
      regionendpoint: <endpoint>
      bucket: <bucket>

redis:
  type: external
  external:
    addr: '<redis-host>:<redis-port>'
    existingSecret: '<valkey-secret>'

Values

KeyTypeDefaultDescription
caBundleSecretNamestring""Custom CA bundle secret name. The secret must contain key named "ca.crt" which will be injected into the trust store for core, jobservice, registry, trivy components caBundleSecretName: ""
caSecretNamestring""

Deploy harbor with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has harbor on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartharbor is pinned at v2.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply