Helm chartv2.2.1App v2.16.0Apache-2.0Verified publisher

A modern, production-ready Helm chart for [Harbor distribution 8gcr](https://github.com/container-registry/8gcr) - the cloud-native container registry for Kubernetes.

About this chart

harbor

A modern, production-ready Helm chart for Harbor distribution 8gcr - the cloud-native container registry for Kubernetes.

TL;DR

# Provide DB credentials via a Secret instead of --set (process list + shell history leak)
kubectl create secret generic my-harbor-db \
  --from-literal=POSTGRESQL_PASSWORD='your-strong-password'

helm install my-harbor oci://8gears.container-registry.com/8gcr/charts/harbor \
  --set externalURL=https://harbor.example.com \
  --set database.host=my-postgres.example.com \
  --set database.existingSecret=my-harbor-db

⚠️ Security: Harbor's default admin credentials (admin / Harbor12345) are publicly known. Set a strong password via harborAdminPassword (or, better, a Kubernetes Secret referenced by existingSecretAdminPassword) and rotate it after the first login.

Why This Chart?

This chart is a ground-up redesign of the Harbor Helm chart with modern Kubernetes best practices, built for 8gcr:

FeatureLegacy harbor-helmThis Chart
Configuration70+ helper templates, hardcoded env varstoEnvVars pattern — any config works
DatabaseBuilt-in PostgreSQL StatefulSetExternal only (production best practice)
RedisBuilt-in Redis DeploymentValkey subchart or external
Ingressnginx reverse proxy + IngressDirect Ingress/Gateway API
SecurityBasic security contextPSS Restricted profile compliant
ValidationNoneJSON Schema validation
Resource DefaultsNone (comments only)Sensible defaults for all components
PodDisruptionBudgetNot availablePer-component PDB support
Templates48 files, 607-line helpers43 files, ~800-line helpers
values.yaml1,116 lines~1,150 lines (317 helm-docs annotations)

Key Features

Future-Proof Configuration with toEnvVars

The chart uses a unique toEnvVars pattern that converts nested YAML configuration to flat environment variables. This means any Harbor configuration option works without chart updates:

core:
  config:
    # These become CONFIG_KEY and NESTED_VALUE env vars
    config_key: "value"
    nested:
      value: "something"
  secret:
    # These become secrets (base64 encoded)
    sensitive_data: "secret-value"

Production-Ready Security

All containers run with Pod Security Standards (PSS) Restricted profile:

  • runAsNonRoot: true — No root containers
  • readOnlyRootFilesystem: true — Immutable container filesystem
  • allowPrivilegeEscalation: false — No privilege escalation
  • capabilities.drop: ["ALL"] — No Linux capabilities
  • seccompProfile.type: RuntimeDefault — Seccomp filtering enabled

High Availability Ready

  • PodDisruptionBudgets — Ensure availability during node maintenance
  • Resource requests/limits — Guaranteed QoS with sensible defaults
  • Affinity/Anti-affinity — Control pod placement
  • Multiple replicas — Scale any component horizontally

Flexible Ingress Options

  1. Standard Kubernetes Ingress (default)
  2. Gateway API HTTPRoute (modern alternative)
  3. extraManifests for custom routing (Traefik IngressRoute, etc.)

Schema Validation

Built-in values.schema.json provides:

  • IDE autocompletion and validation
  • Required field enforcement (externalURL, database.host)
  • Type checking and enum validation
  • Immediate feedback on configuration errors
  • Typo detection: unknown top-level keys are rejected (additionalProperties: false at the root). Component config blocks stay open by design — the generic passthrough means new application config keys never require a chart change.

Architecture

Prerequisites

  • Kubernetes 1.28+ (we follow endoflife.date/kubernetes for supported versions)
  • Helm 3.x
  • External PostgreSQL database (required)
  • PV provisioner (for filesystem storage)

Installing the Chart

Basic Installation

# Pre-create the DB credential and admin Secrets so passwords never appear on the CLI
kubectl create namespace harbor
kubectl -n harbor create secret generic my-harbor-db \
  --from-literal=POSTGRESQL_PASSWORD='your-strong-db-password'
kubectl -n harbor create secret generic my-harbor-admin \
  --from-literal=HARBOR_ADMIN_PASSWORD='your-strong-admin-password'

helm install my-harbor oci://8gears.container-registry.com/8gcr/charts/harbor \
  --namespace harbor \
  --set externalURL=https://harbor.example.com \
  --set database.host=postgres.example.com \
  --set database.existingSecret=my-harbor-db \
  --set existingSecretAdminPassword=my-harbor-admin

With Values File

helm install my-harbor oci://8gears.container-registry.com/8gcr/charts/harbor \
  --namespace harbor \
  --create-namespace \
  -f values-production.yaml

Configuration

Required Values

KeyDescription
externalURLPublic URL for Harbor (e.g., https://harbor.example.com)
database.hostPostgreSQL host
database.passwordPostgreSQL password (or use database.existingSecret)

Image source and registry

By default the chart pulls the 8gcr images. Switch every component to the upstream goharbor images (docker.io/goharbor/*) with a single value:

image:
  source: upstream   # 8gcr (default) | upstream

Override an individual image with <component>.image.{registry,repository,tag,digest} — repository is the path without the registry host, and digest pins by sha256 instead of the tag. For an air-gapped mirror, set global.imageRegistry to override the host for all images at once; it preserves the repository path and wins over image.source. See example/upstream-goharbor/.

Component Configuration

Each Harbor component (core, portal, registry, jobservice, exporter) supports:

KeyDescription
<component>.replicasNumber of replicas (ignored when autoscaling.enabled=true)
<component>.autoscalingenabled/minReplicas/maxReplicas/CPU+memory targets — see HPA section
<component>.resourcesCPU/memory requests and limits
<component>.configApplication config (becomes ConfigMap env vars)
<component>.secretSensitive config (becomes Secret env vars)
<component>.extraEnvAdditional env vars with valueFrom support
<component>.lifecycleContainer preStop/postStart hook spec — see Lifecycle hooks
<component>.probesFull K8s probe specs (startup/liveness/readiness), rendered verbatim. Defaults: 2s-period startupProbe (ready as soon as the endpoint responds, no fixed initialDelay), 5s readiness, 10s liveness. Set a probe to null to omit it
<component>.hostAliases/etc/hosts entries (list of {ip, hostnames}) for private DNS targets
<component>.pdb.enabledEnable PodDisruptionBudget
<component>.pdb.minAvailableMinimum available pods during disruption
<component>.affinityPod affinity rules
<component>.nodeSelectorNode selection constraints
<component>.tolerationsPod tolerations
<component>.securityContextContainer security context
<component>.podSecurityContextPod security context
<component>.serviceAccount.createCreate dedicated ServiceAccount

Default Resource Allocations

ComponentCPU RequestMemory RequestMemory Limit
Core100m256Mi512Mi
Registry100m256Mi512Mi
Portal100m128Mi256Mi
Jobservice100m256Mi512Mi
Exporter100m128Mi256Mi

Example Values Files

The example/ directory contains one directory per scenario, each with a ready-to-use values.yaml (every one is render-checked in CI):

DirectoryDescription
k3d-local/Local development with k3d cluster
rke2-rancher/RKE2/Rancher deployment
private-ca/Private-CA / mTLS: PG with verify-full + Redis over TLS + shared CA for S3/OIDC
openshift/OpenShift deployment with edge-terminated routes
aws-eks-irsa/AWS EKS with IRSA for S3 storage and RDS IAM Auth
flux/FluxCD GitOps: HelmRelease + drift detection + pinned secrets (autoGenSecrets: false), works for Argo CD too
argocd/Argo CD Application: OCI chart + $values git source, pinned secrets (autoGenSecrets: false is mandatory under client-side rendering)
helm install harbor . -n harbor --create-namespace -f example/k3d-local/values.yaml

Configuration Examples

Production Setup with High Availability

externalURL: https://harbor.example.com

# External database (required)
database:
  host: postgres.example.com
  password: your-db-password
  sslmode: require

# HA: PDB + autoscaling. `replicas:` is ignored once autoscaling kicks
# in — the HPA owns the count and the Deployment template OMITS the
# field so helm upgrade does not fight the HPA on every roll-out.
core:
  pdb:
    enabled: true
    minAvailable: 1
  autoscaling:
    enabled: true
    minReplicas: 2
    maxReplicas: 10
    targetCPUUtilizationPercentage: 70
  resources:
    requests:
      cpu: 200m
      memory: 512Mi
    limits:
      memory: 1Gi

portal:
  pdb:
    enabled: true
    minAvailable: 1
  autoscaling:
    enabled: true
    minReplicas: 2
    maxReplicas: 6
    targetCPUUtilizationPercentage: 70

registry:
  pdb:
    enabled: true
    minAvailable: 1
  autoscaling:
    enabled: true
    minReplicas: 2
    maxReplicas: 8
    targetCPUUtilizationPercentage: 70

# Ingress with TLS
ingress:
  enabled: true
  className: nginx
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  hosts:
    - host: harbor.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: harbor-tls
      hosts:
        - harbor.example.com

# Use Valkey for Redis
valkey:
  enabled: true
  architecture: standalone

Registry configuration (YAML passthrough)

registry.config accepts the full distribution/distribution config.yml schema verbatim — every key distribution supports works without chart changes. The chart wholesale renders this block into /etc/registry/config.yml, merging only a small set of chart-managed runtime values (redis, log.level, http.addr/debug) on top via Helm mustMergeOverwrite. User keys always win on collision.

Three customization tiers:

  1. Default — ship-shape filesystem backend out of the box, no override needed.
  2. Inline — edit registry.config in your values file.
  3. External ConfigMap — own config.yml outside the chart entirely.

Switching storage backend — set exactly one driver key under storage:. The chart default deliberately ships no driver, so your s3: can't collide with a chart-side filesystem: (Helm deep-merge). When no driver is set, the chart injects filesystem: {rootdirectory: /storage} at render time; defining two or more drivers fails at helm install/template time with a message naming them — instead of distribution CrashLooping at boot:

registry:
  config:
    storage:
      s3:
        region: us-east-1
        bucket: my-harbor-bucket
        # forcepathstyle: true  # MinIO / Ceph RGW / SeaweedFS

Credentials never go in registry.config (they'd be visible in the rendered ConfigMap). Use one of:

  • BYO Secret (recommended) — registry.storageCredentials.<backend>.existingSecret references a pre-existing Secret. The chart injects REGISTRY_STORAGE_<BACKEND>_<KEY> env vars on both the registry container and the registryctl sidecar (registryctl runs garbage collection and needs the same creds). Distribution honors these env overrides for any config.yml field.
  • Inline (dev) — registry.secret: { REGISTRY_STORAGE_S3_ACCESSKEY: <plain> } gets b64-encoded into the chart-generated Secret and injected via envFrom.

S3 Storage Backend

registry:
  config:
    storage:
      s3:
        regio

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.2.1 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