Skip to content

Harbor

Container registry for the platform, served at harbor.prod.skatzi.com. Every image under harbor.prod.skatzi.com/skatzi/* (Taskbase, agent-runner, the docs site) and the agent-runner chart are pulled from here. Harbor's own images (goharbor/*) come from Docker Hub.

Overview

Deployed by the harbor component (components/harbor/base/helmrelease.yaml, chart 1.19.4, Harbor 2.15.4) on hetzner-mgmt, wired in cluster/hetzner-mgmt/harbor/kustomization.yaml.

State

Data Where
Images and charts (layers, manifests) S3 bucket skatzi-harbor-registry in Hetzner Object Storage (fsn1, project skatzi-apps), under the prefix registry/
Harbor database (projects, users, tags, scan results) volume harbor-database-pvc (10 Gi hcloud volume 104318759), bundled PostgreSQL harbor-database (goharbor/harbor-db)
Redis cache volume data-harbor-redis-0 (1 Gi hcloud volume, the chart's default)
Job service logs (the file job logger) volume harbor-jobservice (1 Gi hcloud volume, the chart's default)

All three volumes are ReadWriteOnce and attach to one node at a time. The chart's updateStrategy.type is therefore Recreate: jobservice and registry stop their old pod before starting the new one. With RollingUpdate, a new jobservice pod scheduled on another node waits for the volume until the Deployment's progress deadline, and the upgrade rolls back (incident 2026-11-04).

The HelmRelease upgrades with spec.upgrade.serverSideApply: disabled. For Recreate, the chart renders rollingUpdate: null. A client-side merge patch deletes the API server's default rollingUpdate (maxSurge/maxUnavailable 25%), but server-side apply does not delete a field that no manager owns. The Deployment is then rejected with spec.strategy.rollingUpdate: Forbidden: may not be specified when strategy type is 'Recreate'.

Image storage in S3

Since #1364 (2026-10-21) the registry stores images in S3. The old registry volume and the migration Jobs were removed in #1396. Values in the HelmRelease:

  • persistence.imageChartStorage.type: s3, rootdirectory: /registry, v4auth: true, secure: true. bucket, region: fsn1 and regionendpoint: https://fsn1.your-objectstorage.com are set at the cluster level.
  • disableredirect: true: clients pull through Harbor instead of being redirected to presigned S3 URLs, so nodes and CI runners only need to reach harbor.prod.skatzi.com.
  • The S3 keys come from OpenBao hetzner-mgmt/harbor/s3 through the ExternalSecret harbor-registry-s3 (components/harbor/secrets/, key patched in the cluster's harbor-secrets Kustomization), as REGISTRY_STORAGE_S3_ACCESSKEY and REGISTRY_STORAGE_S3_SECRETKEY, the names the chart's s3.existingSecret expects.
  • Path-style addressing needs no setting: Harbor's registry (distribution 2.8) switches to path-style whenever regionendpoint is set, and skips its AWS region check then (s3.go).

The bucket, its lifecycle rule (abort incomplete uploads after 1 day) and its key are owned by the Terraform stage terraform/environments/hetzner-object-storage/. Never set bucket policy or lifecycle from the cluster. The bucket has no versioning or object lock, because Harbor's garbage collection has to delete layers. The backup key can't reach it, and its key can't reach the backups (Backups).

The bucket's size shows on the Platform health Object Storage panels and counts towards the 800 GB alert. The scanner is components/object-storage-exporter run a second time by components/object-storage-exporter-harbor, in its own namespace object-storage-exporter-harbor with the ExternalSecret harbor-bucket (OpenBao hetzner-mgmt/harbor/s3). The key has full rights on the bucket, so it stays out of harbor's other workloads, monitoring and the backup scanner; that namespace has no backup.skatzi.com/store label, so the backup key is never placed there.

Dependencies

  • Hetzner Object Storage (fsn1) for every pull and push. See Known risk.
  • OpenBao and External Secrets Operator for the S3 keys, the admin password and the OIDC secret.
  • Keycloak (OIDC sign-in), the shared Gateway (HTTPRoute), Hetzner CSI (database volume).

Database probes and requests

The chart's database.internal probes default to timeoutSeconds: 1. /docker-healthcheck.sh can take longer than that when the node is CPU-saturated. On 2026-11-03 (#2402), worker-1 was 98 % busy with a load of 23 on 4 cores. The liveness probe timed out three times in a row, and the kubelet killed Postgres in the middle of its crash recovery. While it was down, the registry got connection refused from harbor-database:5432 and CI image pulls failed.

Value Setting Why
livenessProbe.timeoutSeconds 5 a slow check on a busy node is not a dead database
livenessProbe.failureThreshold 6 60 s of failed checks before a restart, instead of 30 s
readinessProbe.timeoutSeconds 5 stops the pod flapping out of the Service on a slow check
resources.requests.cpu 100m covers the 88m peak during recovery; the request also sets Postgres's CPU share when the node is saturated
resources.requests.memory 200Mi above the 7-day working-set maximum of 137Mi

initialDelaySeconds (300 s liveness) and periodSeconds (10 s) keep the chart defaults. There are no limits. A change to these values rolls the harbor-database StatefulSet, which restarts the database once.

Tag retention

Project skatzi has one tag retention rule, set in the Harbor UI (Projects → skatzi → Policy → Tag Retention), not in Git: for repositories ** and tags **, retain the most recently pushed 15 artifacts; untagged artifacts are not retained. A multi-arch release pushed with per-arch tags (index, -amd64, -arm64) counts as 3, so a repository keeps about its last 5 releases.

Until 2026-10-30 the rule kept 3, which is one release. Each new release deleted the version still pinned elsewhere: the agent runners' image and chart on 2026-10-28, and the demo shop's webshop-platform:v1.37.0 on 2026-10-30 (report). Keep the count well above the number of releases between two Renovate bumps of a pin. After changing the rule, run its Dry run and check that every deployed tag is retained (task #1934).

The rule never deletes an immutable tag. Since 2026-11-04 a Tag Immutability rule covers the release tags (*.*.*) of webshop-platform, webshop-shop-template-frontend, charts/webshop and charts/webshop-admin (incident report), so those tags stay until they are pruned by hand:

  1. Every Monday at 08:00 (Europe/Copenhagen) eloro's operator lists the tags that no shop, starter, demo, Git ref or pod has pinned for 30 days (eloro/webshop-platform scripts/harbor-prune-list.sh, design 06 §4.4; eloro #2690, #2695, #3436).
  2. The owner approves the list.
  3. A Harbor admin relaxes the immutability rule for those tags, or deletes them as an admin.
  4. The admin runs garbage collection, so the bucket frees the blobs.
  5. The admin checks with a HEAD that every tag pinned today still answers 200.

This prune is what keeps the bucket, and with it the upgrade gate's downtime, bounded (owner's decision, #3316).

The prune runs weekly with a 30-day window, not monthly with 90 days (owner's decision of 2026-11-19, #3437). The bucket grows about 2 GiB a day (runbook), so under a monthly 90-day prune it would reach the gate's 100 GiB bound around mid-December 2026.

Known risk: Object Storage outage

Every image pull through Harbor reads from Hetzner Object Storage (disableredirect doesn't change that; Harbor streams the layer from S3). If Object Storage is degraded (it had incidents in 2026), pulls of harbor.prod.skatzi.com/* images fail. New pods that need a Harbor image can't start anywhere until it recovers: rescheduled pods, rollouts, CI jobs. Running pods are unaffected, and nodes that already have an image cached can start pods with imagePullPolicy: IfNotPresent. Pushes fail too, so releases stop.

The alert HarborRegistryStorageErrors (critical, incident) fires when more than 5 % of the registry's requests answer 5xx for 10 minutes. The blackbox probe of https://harbor.prod.skatzi.com only loads the portal and does not touch storage. The registry's metrics are scraped through the chart's ServiceMonitor (metrics.serviceMonitor.enabled).

Backups and upgrades

A Harbor upgrade is applied only after the running version has been backed up and the backup restored, and a weekly drill restores the latest backup. See Backups, Upgrade Gate and Restore Drill, including the manual restore. A failed upgrade is rolled back automatically by restoring that backup: see Post-upgrade Smoke Check and Rollback.

The harbor-db image upgrades PostgreSQL in place when a new Harbor version brings a new PostgreSQL major. Its entrypoint (docker-entrypoint.sh 14 15 in v2.14.1) runs pg_upgrade and then deletes the old data directory. A Harbor upgrade is therefore one-way, which is why it is stateful (Renovate architecture §5).

The gate copies the bucket's registry/docker/ into its backup with the harbor-registry-s3 keys while the registry is stopped. The restore check and the drill run the scratch copy on a volume, never on the bucket, and the rollback restores the blobs into the bucket, keeping what it replaces under rollback-aside/<stamp>/.

Restoring images

  • Object deleted or bucket damaged: the bucket has no versioning, and its only other copy is the latest gate backup in skatzi-backups, as of the last Harbor upgrade (a copy outside Hetzner is still planned, see Choosing the backup store). Our own images are rebuilt and pushed by their release CI. Re-run the release workflow of the repository, or push the tag again. Upstream images mirrored by hand must be copied again.
  • Harbor database lost: the images in S3 stay, but projects, tags and permissions are in the database volume harbor-database-pvc, which the upgrade gate backs up with pg_dump. Re-pushing an image recreates its tags.