B Example of a Private Registry HA setup Helm chart #
The following example values file illustrates a starting point for a Private Registry HA setup. It uses external PostgreSQL and external Valkey or Redis services. This example uses three replicas for the main services. Two replicas provide basic redundancy, but three replicas leave two instances available after one pod or node becomes unavailable. Three replicas also provide more capacity during planned maintenance or a rolling update.
Replicas alone do not make the deployment tolerate a node failure.
The example therefore also sets topologySpreadConstraints, so that the replicas of a component are placed on different nodes, and nodeSelector, so that the registry components run on a dedicated worker-node pool with sufficient capacity.
The selected nodes must have the label specified in the nodeSelector configuration.
For the design decisions behind these values, see Chapter 6, High Availability setup. For the complete list of values, see Appendix A, Overriding the SUSE Private Registry Helm chart.
expose:
type: ingress
tls:
enabled: true
certSource: secret 1
secret:
secretName: <TLS_SECRET_NAME>
ingress:
hosts:
core: <PRIVATE_REGISTRY_FQDN> 2
externalURL: https://<PRIVATE_REGISTRY_FQDN> 3
harborAdminPassword: "<MY_PASSWORD>" 4
core:
replicas: 3 5
nodeSelector:
<NODE_LABEL_KEY>: <NODE_LABEL_VALUE> 6
topologySpreadConstraints: 7
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
matchLabelKeys:
- pod-template-hash 8
labelSelector:
matchLabels:
component: core
release: <RELEASE_NAME>
portal:
replicas: 3
# Repeat the nodeSelector and topologySpreadConstraints of the core
# component, with "component: portal" in the label selector. 9
registry:
replicas: 3
# Repeat with "component: registry" in the label selector.
jobservice:
replicas: 3
jobLoggers:
- database 10
# Repeat with "component: jobservice" in the label selector.
# Increase Trivy replicas when vulnerability scanning is a critical workload
trivy:
replicas: 3
# Repeat the nodeSelector and topologySpreadConstraints of the core
# component, with "component: trivy" in the label selector, but without
# matchLabelKeys.
# With "expose.type: ingress" the chart does not deploy its own nginx proxy,
# so "nginx.replicas" has no effect. Endpoint redundancy comes from the
# Ingress controller. 11
metrics:
enabled: true 12
serviceMonitor:
enabled: true 13
# While not strictly for the HA of the registry itself, consider increasing exporter replicas for robust monitoring availability
exporter:
replicas: 3
# Repeat with "component: exporter" in the label selector.
# The CA certificate that signed the certificate of the external PostgreSQL
# server. The secret must contain the key "ca.crt".
caBundleSecretName: <CA_SECRET_NAME> 14
database:
type: external
external: 15
host: <POSTGRESQL_HOST>
port: "5432"
username: <POSTGRESQL_USER>
coreDatabase: "registry"
existingSecret: <POSTGRESQL_SECRET_NAME> 16
sslmode: "verify-full" 17
redis:
type: external
external: 18
addr: <VALKEY_HOST>:6379 19
sentinelMasterSet: "" 20
coreDatabaseIndex: "0" 21
jobserviceDatabaseIndex: "1"
registryDatabaseIndex: "2"
trivyAdapterIndex: "5"
harborDatabaseIndex: "6" 22
cacheLayerDatabaseIndex: "7" 23
username: "" 24
existingSecret: <VALKEY_SECRET_NAME> 25
persistence:
enabled: true 26
resourcePolicy: keep 27
persistentVolumeClaim:
registry:
storageClass: <STORAGE_CLASS_NAME>
accessMode: ReadWriteMany 28
size: 500Gi 29
trivy:
storageClass: <STORAGE_CLASS_NAME>
size: 20Gi 30Can be | |
Core service host name in Ingress rule. | |
The external URL for the | |
The initial administrator password. In production, store the password in a Kubernetes secret and reference it with | |
Number of replicas to create. Two replicas provide basic redundancy. Three replicas are a recommended production starting point because two instances remain available after one pod or node becomes unavailable. Replicas do not guarantee node failure tolerance unless you distribute them across different nodes or failure domains. | |
Schedules the component on a dedicated worker-node pool. The selected nodes must carry this label. | |
Places the replicas of the component on different nodes. Set | |
Counts only the pods of the revision being rolled out. Without it, a rolling update also counts the pods it is about to replace, so the replacements can be placed on fewer nodes than | |
Apply the same | |
Writes job logs to the database instead of a volume. The default | |
The chart deploys its own nginx proxy only when | |
Required for the exporter to be deployed. Defaults to | |
Creates a Prometheus | |
The name of an existing secret containing the CA certificate that signed the certificate of the external PostgreSQL server. The key in the secret must be | |
Provide the database connection details in the | |
The name of an existing secret containing the database password. The key in the secret must be | |
Accepts one of the following values:
| |
Provide the connection information in the | |
Supports direct and Sentinel connections. Cluster mode is not supported. | |
The name of the set of Valkey or Redis instances to monitor. It must be set for a Sentinel connection. | |
Must be | |
Optional. The database index for miscellaneous business logic. Defaults to | |
Optional. The database index for the cache layer. Defaults to | |
If empty, it is authenticated against the default user. | |
The name of an existing secret containing the Valkey or Redis password. The key in the secret must be | |
To store all the images, metadata and scans, ensure that the persistence-related settings (Persistence parameters) are properly configured. | |
Keeps the PVCs when the Helm release is deleted. This setting does not replace backups and does not protect the PVCs from deletion outside Helm. | |
Replace | |
The chart default of | |
The chart default of |
For a production deployment, store the registry content in external object storage instead of a file system volume.
Object storage removes the shared-volume requirement and keeps the registry content available when a worker node fails.
Replace the persistence.persistentVolumeClaim.registry values with an imageChartStorage configuration. For example:
persistence:
enabled: true
resourcePolicy: keep
imageChartStorage:
type: s3 1
s3:
region: <S3_REGION>
bucket: <S3_BUCKET>
accesskey: <S3_ACCESS_KEY>
secretkey: <S3_SECRET_KEY>
disableredirect: true 2
persistentVolumeClaim:
trivy:
storageClass: <STORAGE_CLASS_NAME>
size: 20GiAccepts | |
By default, the registry responds to pull requests by redirecting clients directly to object storage. Set |