wordpress

by HelmForge

Helm chartv3.3.3App 7.1.5Apache-2.0Verified publisher

A Helm chart for deploying WordPress on Kubernetes with MySQL support and S3 backup

About this chart

WordPress

A Helm chart for deploying WordPress on Kubernetes with the official wordpress Apache image, HelmForge MySQL, external database support, backups, metrics, Gateway API, dual-stack Services, NetworkPolicy, and External Secrets Operator integration.

Installation

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install wordpress helmforge/wordpress
helm install wordpress oci://ghcr.io/helmforgedev/helm/wordpress

Upgrade notes for 7.1.3

WordPress 7.1.3 is a maintenance and security release with seven security fixes and four bug fixes. The security fixes cover stored XSS, denial of service, second-order SQL injection, authorization weaknesses, disclosure of comments on private or unpublished posts, unsafe embeds, and hook action-name collisions. Back up the database and wp-content before upgrading. The chart synchronizes the core files from the selected image into the persistent volume while preserving wp-content, wp-config.php, .htaccess, and custom root files. After upgrading, verify the site, administration pages, comments, embeds, exports, and scheduled jobs. Custom repositories skip synchronization unless coreSync.allowCustomImage=true; opt in only when the image retains the official /usr/src/wordpress layout and standard shell utilities.

See the WordPress 7.1.3 release announcement for the upstream details.

Quick Start

The default path is intentionally convenient for development and evaluation: one WordPress Deployment, a bundled MySQL subchart, a persistent volume for /var/www/html, and generated credentials.

helm install wordpress oci://ghcr.io/helmforgedev/helm/wordpress \
  --set wordpress.adminPassword=change-me \
  --set mysql.auth.password=db-password

Dev vs Production

Defaults are not intended to be a complete production baseline. They provide a fast working install. For production, enable explicit credentials, TLS at the edge, resource requests and limits, backups, metrics, restricted network flow, and a storage/database strategy that matches your availability target.

Production-ready options are available through values:

  • External or bundled MySQL with existing Secrets or External Secrets Operator.
  • Gateway API HTTPRoute or classic Ingress.
  • Service dual-stack fields (ipFamilyPolicy, ipFamilies).
  • NetworkPolicy ingress and optional egress allow lists.
  • PodDisruptionBudget and HorizontalPodAutoscaler.
  • Kubernetes CronJob for deterministic wp-cron.php execution.
  • S3-compatible scheduled backups for database and wp-content.
  • WP-CLI bootstrap Job for repeatable first-install setup.
  • Structured wp-config.php settings for SSL admin, file editor lockout, cron, and memory limits.

Features

  • Official WordPress Apache image.
  • HelmForge MySQL subchart or external MySQL/MariaDB.
  • External Secrets Operator support with external-secrets.io/v1.
  • Secret preservation across upgrades with lookup for chart-managed Secrets.
  • Persistent storage for themes, plugins, uploads, and core files.
  • Ingress and Gateway API exposure patterns.
  • Dual-stack Service support.
  • Optional NetworkPolicy for ingress and egress control.
  • Optional HPA and PDB for production availability.
  • Optional Prometheus metrics through Apache exporter and ServiceMonitor.
  • Optional scheduled backups to S3-compatible storage.
  • Extensibility through extraEnv, extraEnvFrom, extra volumes, extra init containers, extra containers, and extra manifests.
  • Optional WP-CLI bootstrap Job for initial core installation, permalink setup, locale activation, and multisite install.
  • Idempotent post-install/post-upgrade installer for WordPress.org plugins and checksum-verified custom ZIPs.
  • Object cache integration with Redis or Memcached provider modes.
  • Redis Object Cache integration with HelmForge Redis subchart or external Redis.
  • Memcached subchart wiring for custom WordPress images that include the required PHP extension.

Production Example

wordpress:
  siteUrl: https://blog.example.com
  adminEmail: [email protected]
  forceSSLAdmin: true
  disallowFileEdit: true
  disableWpCron: true
  memoryLimit: 256M
  maxMemoryLimit: 512M

admin:
  existingSecret: wordpress-admin

mysql:
  enabled: false

database:
  external:
    host: mysql.example.com
    port: 3306
    name: wordpress
    username: wordpress
    existingSecret: wordpress-db
    existingSecretPasswordKey: password

persistence:
  enabled: true
  accessMode: ReadWriteMany
  storageClass: nfs-rwx
  size: 20Gi

service:
  ipFamilyPolicy: PreferDualStack
  ipFamilies:
    - IPv4
    - IPv6

gatewayAPI:
  enabled: true
  parentRefs:
    - name: public
      namespace: gateway-system
  hostnames:
    - blog.example.com

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 5

pdb:
  enabled: true
  minAvailable: 1

wpCron:
  cronJob:
    enabled: true

bootstrap:
  enabled: true
  permalinkStructure: /%postname%/

networkPolicy:
  enabled: true
  ingress:
    extraFrom:
      - namespaceSelector:
          matchLabels:
            kubernetes.io/metadata.name: gateway-system
  egress:
    enabled: true
    allowDNS: true
    allowSameNamespaceDatabase: false
    allowHTTPS: true

backup:
  enabled: true
  schedule: "0 3 * * *"
  s3:
    endpoint: https://s3.amazonaws.com
    bucket: wordpress-backups
    existingSecret: wordpress-s3

resources:
  requests:
    cpu: 250m
    memory: 512Mi
  limits:
    cpu: "1"
    memory: 1Gi

External Secrets Operator

External Secrets is optional. When enabled, the chart renders ExternalSecret resources and stops rendering the matching native Secret.

externalSecrets:
  enabled: true
  secretStoreRef:
    name: vault
    kind: ClusterSecretStore
  admin:
    enabled: true
    passwordRemoteRef:
      key: prod/wordpress
      property: admin-password
  database:
    enabled: true
    passwordRemoteRef:
      key: prod/wordpress
      property: database-password

mysql:
  enabled: false

database:
  external:
    host: mysql.example.com
    existingSecretPasswordKey: database-password

The chart validates that externalSecrets.apiVersion is external-secrets.io/v1, a SecretStore is configured, and ExternalSecret-managed credentials are not combined with existingSecret for the same credential.

Plugins

The chart can run an idempotent plugin installer Job after install and upgrade. The Job mounts the WordPress PVC and skips plugins that already exist, so upgrades do not reinstall the same plugin repeatedly.

plugins:
  enabled: true
  installer:
    enabled: true
    image:
      repository: example.com/custom-wordpress-cli
      tag: cli-php8.3-memcached
  items:
    - slug: classic-editor
      activate: true
      skipIfInstalled: true
    - slug: contact-form-7
      activate: true
      skipIfInstalled: true
  custom:
    - name: company-plugin
      url: https://plugins.example.com/company-plugin-1.4.2.zip
      sha256: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
      activate: true
      skipIfInstalled: true
      authentication:
        existingSecret: wordpress-plugin-download
        tokenKey: token

The installer uses a post-install,post-upgrade Helm hook and pod affinity to run on the same node as the WordPress pod when persistence is enabled. This improves compatibility with ReadWriteOnce PVCs. The default installer deadline is 60 seconds with one retry, so failed official plugin downloads fail quickly during Helm installs. Because the Job writes plugin files to the WordPress volume, plugins.installer.enabled requires persistence.enabled=true.

Entries under plugins.items remain restricted to official WordPress.org slugs. Entries under plugins.custom accept HTTPS ZIP URLs only, require an exact SHA-256 checksum, and can read a bearer token only from an existing Kubernetes Secret. The token is exposed to the downloader through an environment variable and is never placed in command arguments or rendered values. The installer rejects unsafe archive paths and unexpected top-level directories, and reports distinct download, checksum, archive, and activation failures. Provision authentication Secrets separately; never put a token in values.

When WordPress core is not installed yet, the Job extracts plugin files into wp-content/plugins and defers activation until a later upgrade. With skipIfInstalled: true, an installed plugin is not downloaded again during an upgrade. The installer runs as www-data by default so it can write to the same PVC paths initialized by the official WordPress image.

WordPress plugins and PHP extensions

A WordPress plugin is PHP application code stored under wp-content/plugins; a PHP extension is a native module loaded by the PHP runtime. Installing a plugin ZIP cannot add an extension such as pdo_mysql or memcached. The official WordPress image includes mysqli, but workloads that require other extensions must build a derivative runtime image. If bootstrap, plugin installation, or another WP-CLI operation needs the same extension, build and select a matching CLI image for that workload too. The chart's WordPress cron CronJob calls the application over HTTP, so its curl image does not load PHP extensions.

The chart never compiles PHP extensions at container startup. See the custom PHP image example for a reusable Dockerfile and GitHub Actions pipeline that scans before publication and emits an SBOM and provenance.

Bootstrap

The official WordPress image creates wp-config.php, but it does not create the initial site, admin user, or permalink settings. Enable the bootstrap Job when you want Helm to complete the first install with WP-CLI.

wordpress:
  siteUrl: https://blog.example.com
  siteTitle: Example Blog
  adminUser: admin
  adminEmail: [email protected]

admin:
  existingSecret: wordpress-admin

bootstrap:
  enabled: true
  permalinkStructure: /%postname%/

The Job is idempotent by default. It exits successfully when WordPress is already installed. For multisite installs, enable wordpress.multisite.enabled and set wordpress.multisite.mode to subdirectory or subdomain.

Object Cache

Redis

Enable Redis Object Cache with the HelmForge Redis subchart:

plugins:
  enabled: true
  installer:
    enabled: true

objectCache:
  enabled: true
  provider: redis
  redis:
    mode: subchart
    subchart:
      enabled: true

redis:
  architecture: standalone

Or connect to external Redis:

plugins:
  enabled: true
  installer:
    enabled: true

objectCache:
  enabled: true
  provider: redis
  redis:
    mode: external
    external:
      host: redis.example.com
    auth:
      existingSecret: wordpress-redis
      existingSecretPasswordKey: redis-password

The chart configures WP_CACHE, WP_REDIS_HOST, WP_REDIS_PORT, WP_REDIS_DATABASE, WP_REDIS_PREFIX, WP_REDIS_CLIENT, and optional WP_REDIS_PASSWORD. It also installs redis-cache and creates wp-content/object-cache.php.

For immutable production deployments, prefer a custom WordPress image with required plugins and drop-ins already packaged. The installer Job is a practical operational convenience for development, labs, and mutable PVC-based installs.

Memcached

Memcached is available as an advanced provider for teams that already use a WordPress image with the PHP memcached extension installed. The official docker.io/library/wordpress image does not ship that extension, so the chart rejects provider: memcached with the official image unless you explicitly acknowledge the limitation.

image:
  repository: example.com/custom-wordpress
  tag: 7.0.0-apache-memcached

plugins:
  enabled: true
  installer:
    enabled: true

objectCache:
  enabled: true
  provider: memcached
  memcached:
    mode: subchart
    subchart:
      enabled: true

memcached:
  architecture: standalone
  memcached:
    memoryLimitMB: 128

Use Redis for the default plug-and-play path. Use Memcached only when the runtime image and plugin strategy are validated for your environment.

Gateway API

Use Gateway API when your cluster exposes applications through Gateway controllers instead of Ingress.

gatewayAPI:
  enabled: true
  parentRefs:
    - name: public
      namespace: gateway-system
      sectionName: https
  hostnames:
    - blog.example.com

The chart creates an HTTPRoute that sends traffic to the WordPress Service.

Parameters

Core

KeyDefaultDescription
replicaCount1WordPress replicas when HPA is disabled
image.configureApachePortnullAuto-configure non-default ports only for the official image; compatible custom Apache images may opt in
containerPorts.http80Apache application listener port, independent from service.port
wordpress.siteUrl""Full site URL
wordpress.siteTitleWordPressSite title
wordpress.adminUseradminInitial admin username
wordpress.adminPassword""Initial admin password, generated when empty
wordpress.adminEmail[email protected]Admin email
wordpress.tablePrefixwp_Database table prefix
wordpress.debugfalseEnables WP_DEBUG
wordpress.forceSSLAdminfalseSets FORCE_SSL_ADMIN
wordpress.disallowFileEditfalseSets DISALLOW_FILE_EDIT
wordpress.disableWpCronfalseSets DISABLE_WP_CRON
wordpress.multisite.enabledfalseEnables WordPress multisite constants
wordpress.multisite.modesubdirectoryBootstrap multisite mode: subdirectory or subdomain
wordpress.memoryLimit""Sets WP_MEMORY_LIMIT
wordpress.maxMemoryLimit""Sets `WP

Deploy wordpress with OpenTenant

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