Skip to content

Scaling & high availability

Entrepot pods are stateless. All shared state lives in Postgres and the blob stores, and the in-process caches (repositories, role bindings, trust policies, verified tokens) hold only a few seconds of data. Scaling out is a matter of storage and configuration.

Requirement Why
Every blob store is S3 or a ReadWriteMany volume (EFS, NFS, CephFS) all replicas read and write the same content. The Helm chart refuses replicaCount > 1 with a ReadWriteOnce store.
The same auth.sessionSecret on all replicas sessions and Docker registry tokens issued by one replica must be valid on the others.
The same secrets.key (if set) on all replicas and scan workers every process must decrypt secrets stored in Postgres.
server.baseURL set URLs in rewritten metadata and OIDC redirects must not depend on which pod answered.

With the chart, set an explicit auth.sessionSecret or auth.existingSecret — a generated secret would otherwise differ between upgrades.

  • Migrations take a Postgres advisory lock, so replicas can start at the same time.
  • Chunked Docker uploads keep their chunks in the blob store’s temp area, so consecutive PATCH requests can land on different pods — no sticky sessions needed.
  • Proxy misses are collapsed per process (singleflight); several replicas may fetch the same new artifact once each, which is harmless because content is addressed by digest.
  • Cleanup runs under a cluster-wide lock, on one replica at a time.
  • Scan jobs are claimed with FOR UPDATE SKIP LOCKED and leases, so any number of workers can run anywhere.
replicaCount: 3
auth:
existingSecret: entrepot-auth
blobStores:
- name: artifacts
type: s3
s3: {bucket: my-entrepot-artifacts, region: eu-west-2, redirectDownloads: true}
podDisruptionBudget:
enabled: true
minAvailable: 2
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 8
targetCPUUtilizationPercentage: 75
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels: {app.kubernetes.io/name: entrepot}
  • Postgres is the shared dependency: give it a highly available setup (RDS Multi-AZ, CloudNativePG). Each replica opens up to database.maxConns connections (default 20); multiply by replicas and scan workers when sizing max_connections.
  • S3 with redirectDownloads takes large downloads off the pods entirely. Without it, bandwidth scales with the number of replicas.
  • /tmp: uploads are spooled to the pod’s /tmp emptyDir while they are hashed. Size tmp.sizeLimit for your largest artifacts times concurrent uploads.
  • Scan workers are CPU- and memory-hungry while scanning images; run them as a separate Deployment (scanning.worker.enabled) so they scale independently and never starve the API. A shared Trivy server (scanning.trivyServer.enabled) keeps a single vulnerability DB.
  • Ingress timeouts must allow slow uploads of large layers; see Ingress.