docker-registry

by SVTECH-NMAA

Helm chartv1.3.0App v1.0.0Verified publisher

Docker registry

About this chart

Docker Registry Chart

Deploy a Docker Registry with one of two storage backends:

  • s3: SeaweedFS S3 backend
  • filesystem: PVC/hostPath PV backend

Install

Run commands from the parent chart directory, for example charts/kubernetes.

SeaweedFS S3

helm -n registry upgrade --install registry ./docker-registry/ \
  --create-namespace \
  --set registry.storageBackend=s3 \
  --set imagePullSecret.username=<username> \
  --set imagePullSecret.password=<token> \
  --set registry.http.secret=<stable-random-secret> \
  --set registry.s3.accesskey=<s3-access-key> \
  --set registry.s3.secretkey=<s3-secret-key>

Filesystem HostPath PV

helm -n registry upgrade --install registry ./docker-registry/ \
  --create-namespace \
  --set registry.storageBackend=filesystem \
  --set imagePullSecret.username=<username> \
  --set imagePullSecret.password=<token> \
  --set registry.http.secret=<stable-random-secret>

Backend Selection

Set the backend with:

registry:
  storageBackend: s3 # s3 | filesystem
  http:
    secret: "<stable-random-secret>"

registry.http.secret must be a stable random value for each release. Generate one with openssl rand -hex 32.

S3 credentials and the registry HTTP secret are rendered into Kubernetes Secrets and injected into the registry container through environment variables. They are not written into the registry ConfigMap.

storage.cache.blobdescriptor is intentionally not rendered because it can hide filesystem consistency issues during bootstrap/migrate writes.

S3 Backend

Use this mode when the registry stores blobs through the SeaweedFS S3 API.

registry:
  storageBackend: s3
  http:
    secret: "<stable-random-secret>"
  s3:
    bucket: registry
    region: us-east-1
    secure: false
    rootdirectory: /
    endpointOverride: ""
    accesskey: ""
    secretkey: ""
    v4auth: true
    forcepathstyle: true
    chunksize: 5242880
    multipartcopythresholdsize: 5368709120
    multipartcopychunksize: 33554432
    multipartcopymaxconcurrency: 1

seaweedfs:
  serviceName: seaweedfs-s3
  namespace: seaweedfs
  port: 8333
  protocol: http
  filerServiceName: seaweedfs-filer-client
  filerPort: 8888

In s3 mode, the chart renders the bucket creation Job.

Filesystem Backend

Use this mode when the registry stores blobs on a mounted PVC/hostPath PV.

registry:
  storageBackend: filesystem
  http:
    secret: "<stable-random-secret>"
  replicaCount: 3
  strategy:
    type: Recreate
  filesystem:
    rootdirectory: /var/lib/registry
    delete:
      enabled: true
  sharedVolume:
    enabled: true
    volumeName: "docker-registry"
    path: "/opt/shared/registry"
    mountPath: /var/lib/registry
    pvcName: "docker-registry-pvc"
    storageSize: 20Gi
    accessModes: ReadWriteOnce
    storageClass: registry-local
    reclaimPolicy: Retain

In filesystem mode, the chart renders PV/PVC templates and does not render the bucket creation Job.

registry.sharedVolume uses a hostPath PV with ReadWriteOnce by default. The Deployment does not render node scheduling constraints, so the chart does not pin registry pods to a specific node. Multiple registry pods reference the same PVC; with ReadWriteOnce, Kubernetes storage semantics still allow read-write mounting only on one node at a time.

Deploy docker-registry with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has docker-registry 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 chartdocker-registry is pinned at v1.3.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