wordpress-helm
by iSenne
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
Deploymentrunning two containers per pod:wordpress-fpm(officialwordpress:*-fpm-alpineimage) andnginx(nginx/nginx-unprivileged, non-root by design — see Known Issues and Limitations). - A
wpcli-setupJob, run as an ArgoCDPostSynchook, 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
mariadbandredissubcharts (cloudpirates/mariadb,cloudpirates/redis), or point at external instances viadatabase.*/cache.redis.*. - A
backupCronJoband an optionalrestoreJob(also a PostSync hook), backed by a dedicated PVC, with optional off-site upload viarclone. - Default-deny
NetworkPolicyresources with explicit allow rules for ingress, DNS, database, cache, and outbound HTTPS (plugin/theme installs, SMTP). - An optional
Ingressand aPodDisruptionBudget.
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
Secretworks, including an External Secrets OperatorExternalSecretmanaged 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 (
existingSecretreferences) — 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
| Name | Description | Value |
|---|---|---|
global | Injected 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. | {} |
nameOverride | Override the chart name used in generated resource names. | "" |
fullnameOverride | Override the fully-qualified app name used in generated resource names. | "" |
App (Deployment)
| Name | Description | Value |
|---|---|---|
app.replicaCount | Pod replica count. Fixed at 1 by the schema — see Introduction. | 1 |
app.automountServiceAccountToken | Project 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.enabled | Create a PodDisruptionBudget for the WordPress Deployment. | false |
app.podDisruptionBudget.minAvailable | Minimum available pods when the PDB is enabled. | 1 |
app.image.wordpress.repository | WordPress container image repository. | wordpress |
app.image.wordpress.tag | WordPress container image tag. | see values.yaml |
app.image.wordpress.pullPolicy | WordPress container image pull policy. | IfNotPresent |
app.image.nginx.repository | Nginx container image repository. Must be a non-root-capable image (default is nginx/nginx-unprivileged). | nginx/nginx-unprivileged |
app.image.nginx.tag | Nginx container image tag. | see values.yaml |
app.image.nginx.pullPolicy | Nginx container image pull policy. | IfNotPresent |
app.resources.wordpress | Resource requests/limits for the wordpress-fpm container. | {requests: {cpu: 200m, memory: 512Mi}, limits: {memory: 1024Mi}} |
app.resources.nginx | Resource requests/limits for the nginx container. | {requests: {cpu: 50m, memory: 128Mi}, limits: {memory: 256Mi}} |
WordPress
| Name | Description | Value |
|---|---|---|
wordpress.siteUrl | Site 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.siteUrlMode | How 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.dynamicAllowedHosts | Hostnames 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.siteTitle | Site title. | WordPress |
wordpress.configExtra | Raw PHP injected into wp-config.php via WORDPRESS_CONFIG_EXTRA (in addition to the chart's own Redis-object-cache defines). | "" |
wordpress.env | Extra environment variables (list of {name, value} or {name, valueFrom}) appended to the wordpress-fpm container. | [] |
wordpress.memoryLimit | WP_MEMORY_LIMIT. | 256M |
wordpress.maxMemoryLimit | WP_MAX_MEMORY_LIMIT. | 512M |
wordpress.persistence.wpContent.enabled | Provision a PVC for wp-content (uploads, plugins, themes survive pod restarts). | true |
wordpress.persistence.wpContent.existingClaim | Use an existing PVC instead of creating one. | "" |
wordpress.persistence.wpContent.storageClassName | StorageClass for the wp-content PVC. Empty uses the cluster default. | "" |
wordpress.persistence.wpContent.size | wp-content PVC size. | 10Gi |
wordpress.persistence.wpContent.accessModes | wp-content PVC access modes. | ["ReadWriteOnce"] |
wordpress.bootstrap.enabled | Run the wpcli-setup PostSync hook Job (core install, admin user, plugins, SMTP config). | true |
wordpress.bootstrap.installCore | Run wp core install when bootstrap is enabled. Set false to only manage plugins/SMTP on an already-installed site. | true |
wordpress.plugins.install | Plugins installed and activated on every bootstrap run (GitOps-declarative — see Plugin Management). | ["wordfence", "wpforms-lite"] |
wordpress.plugins.activate | Plugins activated only (must already be present on the PVC, e.g. manually uploaded). | [] |
wordpress.plugins.autoUpdateAll | Enable WordPress auto-updates for every installed plugin. | true |
wordpress.wpCli.extraCommands | Extra 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.existingSecret | Required. Secret name with the admin user/password/email — see External Secrets. | "" |
wordpress.admin.userKey / passwordKey / emailKey | Keys inside wordpress.admin.existingSecret. | user / password / email |
wordpress.smtp.existingSecret | Required. Secret name with SMTP credentials — see External Secrets. | "" |
wordpress.smtp.userKey / passwordKey / hostKey / fromKey | Keys inside wordpress.smtp.existingSecret. | user / password / host / from |
wordpress.smtp.fromName | SMTP "from" display name. | WordPress |
wordpress.smtp.port | SMTP port. | 587 |
wordpress.smtp.protocol | SMTP encryption: tls, ssl, or none. | tls |
Nginx and PHP
| Name | Description | Value |
|---|---|---|
nginx.config | Full 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.clientMaxBodySize | client_max_body_size in the nginx server block. | 64m |
php.ini | Full replacement php.ini file content, mounted in place of the chart's generated one. | "" |
php.settings.memoryLimit | PHP memory_limit. Empty falls back to wordpress.memoryLimit (single source of truth); set explicitly to override independently. | "" |
php.settings.uploadMaxFilesize | PHP upload_max_filesize. | 64M |
php.settings.postMaxSize | PHP post_max_size. | 64M |
php.settings.maxExecutionTime | PHP max_execution_time (seconds). | 120 |
php.settings.maxInputTime | PHP 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
| Name | Description | Value |
|---|---|---|
service.type | Kubernetes Service type. | ClusterIP |
service.port | Service port. | 80 |
service.targetPort | Container port the Service forwards to (nginx). | 8080 |
ingress.enabled | Create an Ingress resource. | false |
ingress.className | ingressClassName on the Ingress. Empty omits the field (uses the cluster's default IngressClass). | "" |
ingress.annotations | Extra annotations on the Ingress (cert-manager issuer, external-dns hostname, etc.). | {} |
ingress.allowedNamespace | Namespace label (kubernetes.io/metadata.name) the ingress-allow NetworkPolicy permits traffic from — set to your ingress controller's namespace. | traefik |
ingress.tls.enabled | Enable TLS on the Ingress. | false |
ingress.tls.secretName | Secret holding the TLS certificate (typically managed by cert-manager). Ignored when ingress.tls.blocks is set. | "" |
ingress.tls.blocks | List 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.hosts | List of {host, paths: [{path, pathType}]}. | [{host: example.com, paths: [{path: /, pathType: Prefix}]}] |
ingress.www.enabled | Also route a www. host to the same backend/paths as ingress.hosts[0]. | false |
ingress.www.host | The www. hostname, used when ingress.www.enabled is true. | www.example.com |
Security
| Name | Description | Value |
|---|---|---|
security.networkPolicy.enabled | Create default-deny NetworkPolicies plus explicit allow rules (ingress, DNS, database, cache, outbound HTTPS/SMTP). | true |
security.networkPolicy.internetEgressExcept | CIDRs 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartwordpress-helm is pinned at v0.7.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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