wordpress-helm

by iSenne

Helm chartv0.7.11App 7.1.5Verified publisher

WordPress helm chart

About this chart

WordPress Helm Chart

A Helm chart for WordPress on Kubernetes: PHP-FPM + Nginx (non-root), an ArgoCD-friendly GitOps-declarative bootstrap job, optional bundled MariaDB and Redis, a backup/restore CronJob+Job pair, and default-deny NetworkPolicies.

Built with AI assistance, human-reviewed — see the repository README for what that means in practice, and tests/ for what's actually verified.

TL;DR

helm install my-wordpress \
  oci://registry.gitlab.com/isenne/wordpress-helm/wordpress-helm \
  --version 0.4.0 \
  --values my-values.yaml

my-values.yaml at minimum needs the secret names described under External Secrets — the bundled MariaDB and Redis subcharts refuse to start without their secrets already existing.

Introduction

This chart deploys:

  • A single-replica Deployment running two containers per pod: wordpress-fpm (official wordpress:*-fpm-alpine image) and nginx (nginx/nginx-unprivileged, non-root by design — see Known Issues and Limitations).
  • A wpcli-setup Job, run as an ArgoCD PostSync hook, that installs WordPress core, creates the admin user, and installs/activates plugins declared in values. Re-runs on every sync — see Plugin Management.
  • Optional bundled mariadb and redis subcharts (cloudpirates/mariadb, cloudpirates/redis), or point at external instances via database.* / cache.redis.*.
  • A backup CronJob and an optional restore Job (also a PostSync hook), backed by a dedicated PVC, with optional off-site upload via rclone.
  • Default-deny NetworkPolicy resources with explicit allow rules for ingress, DNS, database, cache, and outbound HTTPS (plugin/theme installs, SMTP).
  • An optional Ingress and a PodDisruptionBudget.

Single-instance only: app.replicaCount is capped at 1 in the schema. Horizontal scaling would need RWX storage for wp-content and a non-Recreate deployment strategy, neither of which this chart implements.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3
  • PV provisioner support (for wordpress.persistence.wpContent, backup.storage, and the bundled MariaDB/Redis persistence, if enabled)
  • Secrets for the WordPress admin user, SMTP, and (if using the bundled subcharts) MariaDB/Redis — see External Secrets. This chart never renders secrets itself; any mechanism that produces a standard Kubernetes Secret works, including an External Secrets Operator ExternalSecret managed in your own wrapper chart.

Installing the Chart

helm install my-wordpress \
  oci://registry.gitlab.com/isenne/wordpress-helm/wordpress-helm \
  --version 0.4.0 \
  --values my-values.yaml

The command deploys the chart on the Kubernetes cluster using the default configuration plus your overrides. See Parameters for the full list of configurable values.

Uninstalling the Chart

helm uninstall my-wordpress

This removes all Kubernetes resources associated with the release except:

  • PersistentVolumeClaims (wordpress.persistence.wpContent, backup.storage, and the MariaDB/Redis subchart PVCs), which are not deleted automatically, matching standard Helm behavior for stateful data. Delete them manually if you want a clean slate.
  • Secrets you created outside this chart (existingSecret references) — this chart never owned them.

Parameters

values.schema.json is the source of truth and is validated automatically on every helm install/template/lint. The tables below are a human-readable companion — keep them in sync by hand when values.yaml/values.schema.json change.

Global

NameDescriptionValue
globalInjected automatically by Helm when this chart is used as a dependency (e.g. from a wrapper chart); propagated to the mariadb/redis subcharts. Not intended to be set directly.{}
nameOverrideOverride the chart name used in generated resource names.""
fullnameOverrideOverride the fully-qualified app name used in generated resource names.""

App (Deployment)

NameDescriptionValue
app.replicaCountPod replica count. Fixed at 1 by the schema — see Introduction.1
app.automountServiceAccountTokenProject a Kubernetes API token into the WordPress pod and the wpcli-setup Job. Nothing this chart ships talks to the Kubernetes API, so it defaults to off.false
app.podDisruptionBudget.enabledCreate a PodDisruptionBudget for the WordPress Deployment.false
app.podDisruptionBudget.minAvailableMinimum available pods when the PDB is enabled.1
app.image.wordpress.repositoryWordPress container image repository.wordpress
app.image.wordpress.tagWordPress container image tag.see values.yaml
app.image.wordpress.pullPolicyWordPress container image pull policy.IfNotPresent
app.image.nginx.repositoryNginx container image repository. Must be a non-root-capable image (default is nginx/nginx-unprivileged).nginx/nginx-unprivileged
app.image.nginx.tagNginx container image tag.see values.yaml
app.image.nginx.pullPolicyNginx container image pull policy.IfNotPresent
app.resources.wordpressResource requests/limits for the wordpress-fpm container.{requests: {cpu: 200m, memory: 512Mi}, limits: {memory: 1024Mi}}
app.resources.nginxResource requests/limits for the nginx container.{requests: {cpu: 50m, memory: 128Mi}, limits: {memory: 256Mi}}

WordPress

NameDescriptionValue
wordpress.siteUrlSite URL (WP_HOME/WP_SITEURL, and the wp core install --url value used by the bootstrap job). Under siteUrlMode: dynamic it supplies the scheme and the canonical host used whenever the request host is not allowlisted, and it stays required as the bootstrap job's install URL.https://example.com
wordpress.siteUrlModeHow WP_HOME/WP_SITEURL are derived. static pins both to wordpress.siteUrl. dynamic derives both per request from the proxy-normalized request host, checked against an allowlist, so one instance can serve several hostnames — see Serving Multiple Hostnames.static
wordpress.dynamicAllowedHostsHostnames honored from the request under siteUrlMode: dynamic; any other request host falls back to wordpress.siteUrl's host. Empty derives the list from wordpress.siteUrl's host plus the rendered ingress hosts — see The host allowlist. Ignored in static mode.[]
wordpress.siteTitleSite title.WordPress
wordpress.configExtraRaw PHP injected into wp-config.php via WORDPRESS_CONFIG_EXTRA (in addition to the chart's own Redis-object-cache defines).""
wordpress.envExtra environment variables (list of {name, value} or {name, valueFrom}) appended to the wordpress-fpm container.[]
wordpress.memoryLimitWP_MEMORY_LIMIT.256M
wordpress.maxMemoryLimitWP_MAX_MEMORY_LIMIT.512M
wordpress.persistence.wpContent.enabledProvision a PVC for wp-content (uploads, plugins, themes survive pod restarts).true
wordpress.persistence.wpContent.existingClaimUse an existing PVC instead of creating one.""
wordpress.persistence.wpContent.storageClassNameStorageClass for the wp-content PVC. Empty uses the cluster default.""
wordpress.persistence.wpContent.sizewp-content PVC size.10Gi
wordpress.persistence.wpContent.accessModeswp-content PVC access modes.["ReadWriteOnce"]
wordpress.bootstrap.enabledRun the wpcli-setup PostSync hook Job (core install, admin user, plugins, SMTP config).true
wordpress.bootstrap.installCoreRun wp core install when bootstrap is enabled. Set false to only manage plugins/SMTP on an already-installed site.true
wordpress.plugins.installPlugins installed and activated on every bootstrap run (GitOps-declarative — see Plugin Management).["wordfence", "wpforms-lite"]
wordpress.plugins.activatePlugins activated only (must already be present on the PVC, e.g. manually uploaded).[]
wordpress.plugins.autoUpdateAllEnable WordPress auto-updates for every installed plugin.true
wordpress.wpCli.extraCommandsExtra shell command lines appended verbatim to the end of the wpcli-setup Job's script (typically wp --path=/var/www/html … --allow-root). The Job re-runs on every sync, so each command must be idempotent — see Extra WP-CLI commands.[]
wordpress.admin.existingSecretRequired. Secret name with the admin user/password/email — see External Secrets.""
wordpress.admin.userKey / passwordKey / emailKeyKeys inside wordpress.admin.existingSecret.user / password / email
wordpress.smtp.existingSecretRequired. Secret name with SMTP credentials — see External Secrets.""
wordpress.smtp.userKey / passwordKey / hostKey / fromKeyKeys inside wordpress.smtp.existingSecret.user / password / host / from
wordpress.smtp.fromNameSMTP "from" display name.WordPress
wordpress.smtp.portSMTP port.587
wordpress.smtp.protocolSMTP encryption: tls, ssl, or none.tls

Nginx and PHP

NameDescriptionValue
nginx.configFull replacement for the built-in nginx server block. Must include a location = /healthz returning 2xx — the nginx container's readiness/liveness probes depend on it.""
nginx.clientMaxBodySizeclient_max_body_size in the nginx server block.64m
php.iniFull replacement php.ini file content, mounted in place of the chart's generated one.""
php.settings.memoryLimitPHP memory_limit. Empty falls back to wordpress.memoryLimit (single source of truth); set explicitly to override independently.""
php.settings.uploadMaxFilesizePHP upload_max_filesize.64M
php.settings.postMaxSizePHP post_max_size.64M
php.settings.maxExecutionTimePHP max_execution_time (seconds).120
php.settings.maxInputTimePHP max_input_time (seconds).120
php.settings.opcache.*OPcache tuning: enable, enableCli, memoryConsumption (MB), internedStringsBuffer (MB), maxAcceleratedFiles, validateTimestamps, revalidateFreq (seconds), fastShutdown.see values.yaml

Service and Ingress

NameDescriptionValue
service.typeKubernetes Service type.ClusterIP
service.portService port.80
service.targetPortContainer port the Service forwards to (nginx).8080
ingress.enabledCreate an Ingress resource.false
ingress.classNameingressClassName on the Ingress. Empty omits the field (uses the cluster's default IngressClass).""
ingress.annotationsExtra annotations on the Ingress (cert-manager issuer, external-dns hostname, etc.).{}
ingress.allowedNamespaceNamespace label (kubernetes.io/metadata.name) the ingress-allow NetworkPolicy permits traffic from — set to your ingress controller's namespace.traefik
ingress.tls.enabledEnable TLS on the Ingress.false
ingress.tls.secretNameSecret holding the TLS certificate (typically managed by cert-manager). Ignored when ingress.tls.blocks is set.""
ingress.tls.blocksList of {hosts: [...], secretName} for serving several domains that each need their own certificate — one spec.tls[] entry per item. When set, it fully replaces the single-secret behavior; see Multiple domains with separate certificates.[]
ingress.hostsList of {host, paths: [{path, pathType}]}.[{host: example.com, paths: [{path: /, pathType: Prefix}]}]
ingress.www.enabledAlso route a www. host to the same backend/paths as ingress.hosts[0].false
ingress.www.hostThe www. hostname, used when ingress.www.enabled is true.www.example.com

Security

NameDescriptionValue
security.networkPolicy.enabledCreate default-deny NetworkPolicies plus explicit allow rules (ingress, DNS, database, cache, outbound HTTPS/SMTP).true
security.networkPolicy.internetEgressExceptCIDRs carved out of the 0.0.0.0/0 internet-egress allow, for both the WordPress pod and the off-site backup Job. Defaults to the RFC1918 private ranges plus link-local (169.254.0.0/16 — includes the cloud-metadata endpoint on every major cloud provider) and CGNAT (100.64.0.0/10 — includes Tailscale's tailnet space), so out of the box the pod's egress excludes internal services, LAN hosts, and those two special-purpose ranges on 80/443/SMTP; an empty list would restore reach to all of them. If a plugin genuinely needs an internal host, prefer an explicit allow rule for that host — set [] (or a narrower list) only as a deliberate choice. WP-Cron caveat: WordPress's own loopback request to WP_HOME (wp-cron.php, fired on every front-end hit unless DISABLE_WP_CRON is set) is silently dropped too if WP_HOME resolves, from inside the cluster, to an address in one of these ranges — verify with wget --spider $WP_HOME from a pod after enabling this.["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16", "100.64.0.0/10"]

The pod and container security contexts are not parameterised. B

Deploy wordpress-helm with OpenTenant

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