drupal

by QuenchWorks

Helm chartv0.0.47App 11.4.13GPL-2.0-or-laterVerified publisher

Hardened Drupal CMS (PHP-FPM + nginx) on a CVE-gated nonroot image, with a bundled MySQL backend.

About this chart

Quenchworks Drupal

Hardened Drupal, the PHP content-management system, on a minimal, nonroot, read-only-rootfs CVE-gated image pinned by digest and cosign-signed. Drupal is served by a Wolfi PHP-FPM + nginx runtime (supervisord): nginx listens on 8080 (nonroot can't bind <1024) and FastCGI-passes .php to php-fpm on 127.0.0.1:9000, with /opt/drupal as the docroot. It runs as uid 1001.

Drupal needs an external MySQL/MariaDB. This chart bundles the Quenchworks MySQL chart by default, provisions a public-files PVC at sites/default/files, and supplies the settings.php the image intentionally omits. That config reads every DB setting and the hash salt from environment variables injected from a managed Secret, so no secret is ever baked into the image or written to disk.

Install

# self-contained: bundles in-cluster MySQL + a files PVC
helm install cms oci://ghcr.io/quenchworks/charts/drupal \
  --set mysql.auth.rootPassword="ChangeMeRoot" \
  --set mysql.auth.password="ChangeMe"

Then finish the install at /core/install.php. The DB password and hash salt are injected from a managed Secret as DRUPAL_* env vars and read by settings.php, so they never appear in the pod's process arguments.

Connect

kubectl port-forward svc/cms-drupal 8080:8080
# site:    http://localhost:8080/
# install: http://localhost:8080/core/install.php
# admin:   http://localhost:8080/admin

Database

By default the bundled Quenchworks MySQL subchart is deployed; its primary Service is <release>-mysql on port 3306. The MySQL image creates mysql.auth.database and the mysql.auth.username/password on first init, and Drupal connects with them. Set mysql.auth.rootPassword and mysql.auth.password for a deterministic install.

To use an external MySQL/MariaDB, set mysql.enabled=false and fill in externalDatabase.* (or externalDatabase.existingSecret carrying the password key). For an external PostgreSQL, also set extraEnvVars: [{name: DRUPAL_DB_DRIVER, value: pgsql}] (the image ships the pdo_pgsql driver).

settings.php & the read-only rootfs

The image ships no sites/default/settings.php (with none present it redirects / to the installer). The chart mounts one from a ConfigMap at /opt/drupal/sites/default/settings.php (read-only, subPath). It resolves the DB connection and the hash salt from the pod environment at request time (php-fpm runs with clear_env=no).

The rootfs is read-only: Drupal core, modules and themes are baked into the signed image, and only sites/default/files (a PVC) and /tmp (emptyDir) are writable. In-place UI updates are therefore closed; rebuild the image to change code. The hash salt is generated once and persisted in the Secret, so upgrades don't invalidate sessions.

Security

/admin and the installer are password-protected, but the public site is meant for readers. By default networkPolicy.allowExternal is false, restricting ingress to the release namespace. Front Drupal with an ingress/TLS proxy and set allowExternal=true to expose it; set drupal.trustedHostPatterns so Drupal only serves your hostnames.

Image provenance

The image is pinned by digest and cosign-signed (keyless / Sigstore):

cosign verify ghcr.io/quenchworks/images/drupal \
  --certificate-identity-regexp 'https://github.com/quenchworks/.+' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Each build also ships an SPDX SBOM and SLSA provenance attestation. Verify them with gh attestation verify oci://ghcr.io/quenchworks/images/drupal --owner quenchworks.

Key values

KeyDefaultDescription
image.repositoryghcr.io/quenchworks/images/drupalImage repo
image.digestpinned sha256:…Immutable image digest (CI-maintained)
drupal.trustedHostPatterns[]Host header patterns Drupal serves (behind a proxy)
drupal.tablePrefix""Database table prefix
replicaCount1Replicas (files PVC is ReadWriteOnce)
service.port8080Public site + /admin + installer port
service.httpsPort443Service port for the TLS listener (container 8443) when tls.enabled.
tls.enabledfalseServe HTTPS on Drupal's own listener; the certificate is mounted at /tls.
tls.existingSecret""Use this kubernetes.io/tls Secret (1st choice).
tls.certManager.enabledfalseRequest a cert-manager Certificate from tls.certManager.issuerRef (2nd choice).
tls.selfSigned.validityDays365Otherwise Helm generates a CA + certificate, kept across upgrades.
persistence.enabledtrueProvision the files PVC
persistence.size10GiFiles PVC size
persistence.mountPath/opt/drupal/sites/default/filesFiles mount path
mysql.enabledtrueDeploy the bundled MySQL backend
mysql.auth.databasedrupalApp database
mysql.auth.usernamedrupalDB user
networkPolicy.allowExternalfalseAllow ingress from outside the namespace
ingress.enabledfalseCreate an Ingress. With tls.enabled it routes to 443: set the controller's backend protocol to HTTPS.
ingress.className""IngressClass to claim it. Empty leaves it unset, so the cluster default applies.
ingress.annotations{}Controller annotations (rewrite targets, body size, cert-manager issuer, ...).
ingress.servicePortnullBackend port. Unset resolves service.port, then service.ports.http / .https.
ingress.hosts[]e.g. [{host: app.example.com}]. A host with no paths gets a single / Prefix path.
ingress.tls[]Standard Ingress TLS list, e.g. [{hosts: [app.example.com], secretName: app-tls}].

Deploy drupal with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has drupal 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 chartdrupal is pinned at v0.0.47 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