cluster-quay

by startxfr

Helm chartv21.3.418App 3.18.0GPL-3.0-or-laterVerified publisher

Helm chart used to configure a Red Hat Quay registry at the cluster level, from the single pod databases of the operator up to a highly available registry (external S3 storage, PostgreSQL clusters of the cluster-crunchy, cluster-cloudnativedb or cluster-percona sub-charts, OIDC login, pod disruption budgets)

About this chart

Cluster Chart : Quay

This helm chart is used to create an operator based deployment of the Red Hat Quay registry, from the single pod databases generated by the operator (default values, the behaviour of the previous releases) up to a highly available registry: configuration bundle rendered by the chart, external S3 object storage, PostgreSQL clusters of Quay and Clair managed by the cluster-crunchy, cluster-cloudnativedb or cluster-percona sub-chart (several instances, synchronous replication, S3 backups, point in time restore, monitoring, network policies) or operated elsewhere, OIDC login, pod disruption budgets, Argo CD Vault Plugin placeholders for every secret.

This chart is part of the cluster-xxx startx helm chart series that doesn't necessarily deploy pods but rather represent a cluster configuration state orchestrated by gitops tools like ArgoCD.

Requirements and guidelines

Read the startx helm-repository homepage for more information on how to use these resources.

RequirementDetail
OpenShift 4.17+ (Kubernetes 1.30+)kubeVersion of the chart
Red Hat Quay 3.18Quay operator from redhat-operators, channel stable-3.18, installed by the operator sub-chart. Cluster wide (openshift-operators) when quay.components.monitoring is managed: the monitoring component requires the AllNamespaces mode
database.mode: crunchyCrunchy Postgres for Kubernetes 5.8 (certified-operators, package crunchy-postgres-operator), installed and configured by the crunchy sub-chart (cluster-crunchy). Support subscription required in production for organizations of 50 employees or more
database.mode: cloudnativedbCloudNativePG 1.30 (community build certified by EDB, package cloudnative-pg, Apache 2.0) or EDB Postgres for Kubernetes (flavor: edb, EDB subscription), installed and configured by the cloudnativedb sub-chart (cluster-cloudnativedb)
database.mode: perconaPercona Operator for PostgreSQL 3.1 (certified-operators, package percona-postgresql-operator-certified, Apache 2.0, built on the Crunchy PGO engine), installed and configured by the percona sub-chart (cluster-percona)
storage.mode: externalAn S3 compatible bucket (Ceph RGW, MinIO, NooBaa, Amazon S3...) with its credentials
storage.mode: operatorOpenShift Data Foundation (NooBaa): the operator creates an ObjectBucketClaim
Backups of the databasesA second S3 bucket reachable from the database pods (crunchy.s3.list, cloudnativedb.s3.list, percona.s3.list)
SecretsPasswords, keys and credentials are expected as Argo CD Vault Plugin placeholders (<path:kv/data/...#key>) or supplied by a values file kept out of Git; the chart never generates them

What the chart renders

ObjectNamespaceCondition
Namespace of the registry (sub-chart project)project.enabled
Subscription and OperatorGroup of the Quay operator (sub-chart operator), of the Container Security operator (sub-chart operatorsec)operator.subscription.namespaceoperator.enabled, operatorsec.enabled
Secret <app>-pull-auth (registry.redhat.io credentials), Secret <app>-adminuser, legacy Route and Serviceregistryrhn.enabled, quay.admin.enabled, route.enabled
QuayRegistryregistryquay.enabled
Secret <name>-config-bundle (config.yaml, clair-config.yaml, extra_ca_cert_*, ssl.cert/key)registryquay.enabled and quay.config.enabled without quay.config.existingSecret
Secret postgresql-client-certs (ca.crt, projected by the operator in /run/secrets/postgresql)registrydatabase.tls.mode: verify-full (also with an existing config bundle)
PodDisruptionBudget quay-app, clair-app, quay-mirror (maxUnavailable: 1)registryquay.enabled and quay.podDisruptionBudgets.enabled
Namespace, OperatorGroup and Subscription of the database operator, PostgresCluster, Cluster or PerconaPGCluster quay-db and clair-db, their Secrets, backups, monitoring and NetworkPolicydatabasescrunchy.enabled, cloudnativedb.enabled or percona.enabled, with the flags of the sub-chart (project.enabled, operator.enabled, cluster.enabled)

"registry" is project.project.name (quay-operator by default, quay-enterprise in the HA values files), "databases" the namespace of the sub-chart entries (crunchy.cluster.list[].namespace). Argo CD sync waves order the objects: namespaces (-10), OperatorGroup (-6), Subscriptions (-5), Secrets and ConfigMaps (1), database clusters and network policies (15), QuayRegistry (25), budgets, scheduled backups and alerts (30).

Deploy this helm chart on openshift

1. Connect to your Openshift cluster

oc login -t <token> <cluster-url>

2. Install the repository

helm repo add startx https://helm-repository.readthedocs.io/en/latest/repos/stable/

3. Get information about this chart

helm show chart startx/cluster-quay
helm show values startx/cluster-quay

4. Install this chart

helm install cluster-quay startx/cluster-quay

Highly available registry with Crunchy databases, every secret in a values file kept out of Git (the chart refuses to render while a required value is missing, helm template cluster-quay startx/cluster-quay --kube-version 1.33.0 -f values-startx-quay-ha-crunchy.yaml -f my-secrets.yaml --set quay.enabled=true shows it without a cluster):

# my-secrets.yaml: the <path:...> placeholders of values-startx-quay-ha-crunchy.yaml, as values
quay:
  config:
    hostname: quay.apps.ocp.example.com
    secretKey: <64 random characters>
    databaseSecretKey: <64 random characters>
storage:
  external:
    host: s3.example.com
    bucket: quay-registry
    accessKey: <access key>
    secretKey: <secret key>
crunchy:
  s3:
    list:
      - name: quay-backup
        namespace: quay-postgres
        endpoint: s3.example.com
        region: us-east-1
        bucket: quay-pgbackrest
        accessKey: <access key>
        secretKey: <secret key>
  cluster:
    list:
      - name: quay-db
        password: <alphanumeric password>
      - name: clair-db
        password: <alphanumeric password>

Lists are replaced, not merged, by Helm: a values file that sets crunchy.cluster.list or crunchy.s3.list must carry the complete entries (copy them from values-startx-quay-ha-crunchy.yaml).

V="-f values-startx-quay-ha-crunchy.yaml -f my-secrets.yaml"
# namespaces, then the operators (approve the InstallPlans: installPlanApproval Manual)
helm install cluster-quay-project startx/cluster-quay $V --set project.enabled=true --set crunchy.project.enabled=true
helm install cluster-quay-operator startx/cluster-quay $V --set operator.enabled=true --set crunchy.operator.enabled=true
oc get installplan -A | grep -E 'quay-operator|postgresoperator'
# databases and registry
helm install cluster-quay-app startx/cluster-quay $V --set quay.enabled=true --set crunchy.cluster.enabled=true

With helm install every object of a release is created at once: the Quay operator retries until the databases accept connections (a few minutes). Argo CD orders the waves and waits for the databases (see below). Passwords and keys are written verbatim in DB_URI and in the Clair connection strings: use alphanumeric values (openssl rand -hex 32), never URL reserved characters.

Default values

Complete deployment of a project with the following characteristics :

  • 1 namespace: named quay-operator without constraints
  • 1 operator: named quay-operator configured with
    • The stable-3.18 channel of the redhat-operators catalog
    • The v3.18.0 version
    • Deployed under the openshift-startx-quay project (subscription and operator group disabled by default)
  • 1 registry: named after the context application (default-quay) configured with
    • every component managed by the operator (single pod PostgreSQL databases, Redis, ObjectBucketClaim storage, Clair, mirroring, HPA, route, TLS, monitoring)
    • the configuration generated by the operator (quay.config.enabled: false)
    • the registry.redhat.io pull Secret, the admin user Secret, the legacy route and service
# Create the project
helm install cluster-quay-project startx/cluster-quay --set project.enabled=true,operator.enabled=false,quay.enabled=false
# Deploy the quay operator
helm install cluster-quay-operator startx/cluster-quay --set project.enabled=false,operator.enabled=true,operator.subscription.enabled=true,operator.operatorGroup.enabled=true,quay.enabled=false && sleep 10
# Configure the registry
helm install cluster-quay-app startx/cluster-quay --set project.enabled=false,operator.enabled=false,quay.enabled=true

Values files

  • startx-quay : Quay operator and registry of the previous releases, every component managed (see values-startx-quay.yaml)
  • startx-secvuln : Container Security operator (see values-startx-secvuln.yaml)
  • startx-quay-ha-crunchy : highly available registry, external S3 storage, Crunchy databases (two instances each, pgBackRest backups, monitoring, network policies), pod disruption budgets, Vault placeholders (see values-startx-quay-ha-crunchy.yaml)
  • startx-quay-ha-cloudnativedb : the same with CloudNativePG databases (three instances for Quay with quorum failover, two for Clair, Barman Cloud backups) (see values-startx-quay-ha-cloudnativedb.yaml)
  • startx-quay-ha-percona : the same with Percona Operator for PostgreSQL databases (two instances each, pgBackRest backups, PMM monitoring ready to switch on) (see values-startx-quay-ha-percona.yaml)
  • values-startx_noinfra*.yaml : the same without the infra node placement of the operators
helm install cluster-quay startx/cluster-quay -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/cluster-quay/values-startx-quay.yaml

Values dictionary

Everything is in values.yaml, with the same comments. Values marked secret are expected from the Argo CD Vault Plugin or from a values file kept out of Git.

Registry (quay.*)

ValueDefaultDescription
enabled, hookedtrue, falseRender the QuayRegistry (and the bundle, budgets); as a helm hook
name""Name of the QuayRegistry; empty: the application name of the context. Every object of the operator is prefixed with it
pullSecretEnabled, admin.*true, admin userPrevious releases: registry.redhat.io pull Secret and admin user Secret (informational; admin.enabled: false drops it)
config.enabledfalsefalse: no config bundle, the operator generates the configuration and manages every component (storage.mode: operator, database.mode: quayOperator enforced). true: config.yaml rendered in Secret <name>-config-bundle
config.hostname""SERVER_HOSTNAME; empty: default route <name>-quay-<namespace>.apps...
config.superUsers[quayadmin]SUPER_USERS
config.userInitializetrueFEATURE_USER_INITIALIZE: POST /api/v1/user/initialize creates the first super user, then set it to false
config.userCreationfalseFEATURE_USER_CREATION (forced to true with OIDC)
config.secretKey, config.databaseSecretKey""SECRET_KEY, DATABASE_SECRET_KEY, 64 random characters each (secret, required). Never change DATABASE_SECRET_KEY once Quay runs: it encrypts the robot tokens and credentials stored in the database
config.registryTitle, registryTitleShortRed Hat Quay, QuayUI titles
config.defaultTagExpiration, tagExpirationOptions2w, [0s,1d,1w,2w,4w]Tag expiration
config.extraConfig{}Any other config.yaml key, merged last (overrides the keys rendered by the chart)
config.extraCaCerts{}name: PEM map, added as extra_ca_cert_<name> (Quay and Clair trust them)
config.existingSecret""Use your own config bundle Secret: nothing of config.yaml, clair-config.yaml or extra_ca_cert_* is rendered; the components still follow storage.mode and database.mode
tls.managed, tls.cert, tls.keytruetrue: route with the cluster wildcard certificate. false: your PEM pair (ssl.cert, ssl.key in the bundle, secret)
components.clair, mirror, hpa, route,

Deploy cluster-quay with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cluster-quay 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 chartcluster-quay is pinned at v21.3.418 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