moodle

by HelmForge

Helm chartv1.2.3App 5.2.2Apache-2.0Verified publisher

Moodle LMS with immutable code, PostgreSQL/MySQL/MariaDB selection and managed cron

About this chart

Moodle

Production-oriented Moodle LMS deployment with official upstream artifacts, PostgreSQL/MySQL/MariaDB, protected bootstrap, read-only application code, scheduled task processing and explicit maintenance operations.

The chart targets Moodle 5.2.2 and PHP 8.4.25 through a digest-pinned MoodleHQ PHP/Apache image. The application archive is independently SHA-256 verified before extraction. MoodleHQ's image supplies the runtime, not the LMS.

Features

  • Read-only Moodle code, configurable non-root Apache listeners, dropped capabilities.
  • PostgreSQL, MySQL or MariaDB: external servers or selectable HelmForge subcharts.
  • Verified database TLS, custom connection ports and existing credential Secrets.
  • Serialized first installation using upstream CLI and database advisory locks.
  • Explicit maintenance Job; normal startup refuses automatic schema migrations.
  • Independent cron and optional ad-hoc task containers sharing code and data.
  • Redis sessions with optional TLS; documented separation from MUC cache mapping.
  • Persistent Moodledata and fail-fast shared-storage requirements for scaling.
  • Ingress, Gateway API, dual-stack Services, NetworkPolicy, HPA and PDB.
  • Existing Secrets, canonical External Secrets integration and SMTP configuration.
  • Authenticated Moodle metrics, isolated listener, ServiceMonitor and alert rules.
  • Complete backup/restore, upgrade, immutable plugin and Bitnami migration guides.

Install

OCI installation:

helm install moodle oci://ghcr.io/helmforgedev/helm/moodle \
  --namespace learning --create-namespace

HTTPS repository installation:

helm repo add helmforge https://repo.helmforge.dev
helm repo update helmforge
helm install moodle helmforge/moodle --namespace learning --create-namespace

The CI release pipeline owns the published chart version.

Quick start

kubectl -n learning rollout status deployment/moodle --timeout=5m
kubectl -n learning port-forward service/moodle 8080:80

Open http://localhost:8080. The upstream installer already initialized the database. Retrieve the generated administrator password in a private terminal:

kubectl -n learning get secret moodle-admin \
  -o jsonpath='{.data.admin-password}' | base64 --decode

The username defaults to admin. Use an existing Secret for production and configure the real public HTTPS URL before directing students to the site. Changing a bootstrap password does not reset an existing Moodle account.

Prerequisites

  • Kubernetes 1.26 or newer and Helm with OCI support.
  • Dynamic PVC provisioning or an existing data claim writable by UID/GID 33.
  • Outbound HTTPS for archive mode, or a compatible immutable application image.
  • PostgreSQL 16+, MySQL 8.4+ or MariaDB 10.11+; PostgreSQL is enabled by default.
  • A real RWX backend and Redis sessions before enabling multiple web replicas.
  • Gateway API or External Secrets controllers only when those integrations are enabled.

Production example

moodle:
  wwwroot: https://learn.example.com
  sslProxy: true
  existingSecret: learning-admin
  adminEmail: [email protected]
persistence:
  size: 50Gi
sessions:
  enabled: true
redis:
  enabled: true
ingress:
  enabled: true
  ingressClassName: nginx
  hosts:
    - host: learn.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: learning-tls
      hosts: [learn.example.com]

Create the referenced admin/TLS Secrets beforehand. This example provides one web replica; it does not claim HA for standalone databases or Redis.

Deployment scenarios

Use the examples directory for disposable development, staging, production, External Secrets and shared-storage deployments. Each scenario is explicit: the chart does not silently select database/storage capacity from a preset. Keep production database and Redis failover under your infrastructure's tested operating procedures.

Security Scan: moodle

FrameworkScore
MITRE + NSA + SOC293.63636%

Security posture acceptable. Local Kubescape 4.0.13 scan of the default render on 2026-09-09, using the same frameworks as CI. Findings include opt-in NetworkPolicy and the bundled database's writable filesystem. The scanner also flags the existing metrics smoke script's literal Bearer authorization header as a misplaced secret; actual tokens are read from Secrets at runtime. This is a Kubernetes configuration assessment, not an image vulnerability scan.

Operational guides

  • operations
  • production
  • backup-restore
  • troubleshooting
  • observability
  • validation

Complete values reference

Bundled PostgreSQL, MySQL, MariaDB and Redis also accept their full HelmForge subchart values. Their schemas validate additional subchart settings; the tables below document every value explicitly set or exposed by the Moodle parent chart.

nameOverride

Override the chart name.

ParameterDefaultMeaning
nameOverride""Override the chart name.

fullnameOverride

Override resource names.

ParameterDefaultMeaning
fullnameOverride""Override resource names.

commonLabels

Additional resource labels; selector labels are reserved.

ParameterDefaultMeaning
commonLabels{}Additional resource labels; selector labels are reserved.

commonAnnotations

Annotations added to all resources created by this chart; resource-specific annotations take precedence.

ParameterDefaultMeaning
commonAnnotations{}Annotations added to all resources created by this chart.

replicaCount

Number of web pods; multiple replicas require RWX and Redis sessions.

ParameterDefaultMeaning
replicaCount1Number of web pods; multiple replicas require RWX and Redis sessions.

image

Official PHP/Apache runtime, separately pinned from the Moodle code.

ParameterDefaultMeaning
image.repositorydocker.io/moodlehq/moodle-php-apacheImage repository; custom images must contain the same PHP/Apache tools.
image.tag8.4-bookwormHuman-readable PHP variant; digest pins the actual bytes.
image.digestsha256:922af51668352004b4255cdc1f726a63f0cee7c1354eaf66dd8d5f2c7cc379b5Multi-architecture manifest digest.
image.pullPolicyIfNotPresentContainer image pull policy.

imagePullSecrets

Registry credentials.

ParameterDefaultMeaning
imagePullSecrets[]Registry credentials.

source

Immutable Moodle code distribution, prepared once per pod.

ParameterDefaultMeaning
source.modearchivearchive downloads a verified release; image copies code baked into image.path.
source.urlhttps://download.moodle.org/download.php/direct/stable502/moodle-5.2.2.tgzOfficial release archive or an HTTPS mirror of identical bytes.
source.sha25672be209e7c0f5341b87de0bc993b2430087fda2769d8c3cc2f32736d1513e88cSHA-256 of the archive; verified before extraction.
source.imagePath/opt/moodleSource directory in a custom image when mode=image.
source.downloadTimeout180Maximum HTTPS download time per attempt in seconds.

moodle

Moodle application settings.

ParameterDefaultMeaning
moodle.wwwroothttp://localhost:8080Public URL without trailing slash. Set the real HTTPS URL in production.
moodle.siteNameMoodle Learning PlatformFull site name used only on first installation.
moodle.shortNameMoodleShort site name used only on first installation.
moodle.languageenInstallation language. Non-English language packs require upstream egress.
moodle.adminUseradminAdministrative account name used only on first installation.
moodle.adminEmail[email protected]Administrative contact email.
moodle.adminPassword""Inline bootstrap password; generated and preserved when empty.
moodle.existingSecret""Existing bootstrap secret. Password changes do not reset an installed account.
moodle.existingSecretPasswordKeyadmin-passwordBootstrap secret password key.
moodle.autoInstalltrueEnable automated first installation into an empty application database.
moodle.sslProxyfalseAllow TLS termination at a trusted proxy; pair with HTTPS wwwroot.
moodle.reverseProxyfalseEnable only when proxy rewrites Host; ordinary Ingress preserves Host.
moodle.disableUpdateAutodeploytrueDisable browser-based plugin installation and code updates.
moodle.noEmailEverfalseDisable outgoing email, useful in restored or staging environments.
moodle.timezoneUTCSite timezone, configured consistently for PHP and Moodle.
moodle.extraConfig""Additional config.php statements before Moodle setup; trusted administrator code.
moodle.extraEnv[]Extra environment variables for PHP workloads, including cron.
moodle.extraEnvFrom[]Extra environment sources for PHP workloads.

database

Application database connection; disable every database subchart for an external server.

ParameterDefaultMeaning
database.typepostgresqlBackend: postgresql, mysql or mariadb. Changing an installed site's backend requires a separate data migration.
database.host""External database hostname; ignored when the selected subchart is enabled.
database.port0External database port; zero selects 5432 for PostgreSQL or 3306 for MySQL/MariaDB.
database.namemoodleExternal database name.
database.usernamemoodleExternal database user.
database.existingSecret""External database password Secret, required when all database subcharts are disabled.
database.existingSecretPasswordKeypasswordPassword key in the external Secret.
database.prefixmdl_Moodle table prefix; at most ten alphanumeric/underscore characters.
database.sslModepreferPostgreSQL libpq SSL mode; use verify-full with a CA for external PostgreSQL.
database.mysqlSslModedisableMySQL/MariaDB TLS mode: disable, require (encryption only), or verify-full (CA and hostname).
database.collationutf8mb4_unicode_ciMySQL/MariaDB collation; Unicode utf8mb4 is required for full Moodle character support.
database.tlsSecret""Optional Secret containing the database CA certificate.
database.tlsCAKeyca.crtCA certificate key in database.tlsSecret.
database.connectTimeout180Maximum wait for authenticated DB connectivity and installer lock.

postgresql

Bundled HelmForge PostgreSQL; full subchart values may be overridden.

ParameterDefaultMeaning
postgresql.enabledtrueDeploy PostgreSQL.
postgresql.architecturestandaloneStandalone or replication; external database is recommended for managed HA.
postgresql.auth.databasemoodleInitial database name.
postgresql.auth.usernamemoodleInitial application user.
postgresql.auth.password""Application password; generated by the subchart when empty.
postgresql.auth.existingSecret""Existing PostgreSQL credentials Secret.
postgresql.auth.existingSecretUserPasswordKeyuser-passwordApplication password key.

mysql

Bundled HelmForge MySQL; full subchart values may be overridden.

ParameterDefaultMeaning
mysql.enabledfalseDeploy MySQL; requires database.type=mysql and the other database subcharts disabled.
mysql.architecturestandaloneStandalone or replication; the Moodle connection always targets the writable Service.
mysql.auth.databasemoodleInitial database name.
mysql.auth.usernamemoodleInitial application user.
mysql.auth.password""Application password; generated by the subchart when empty.
mysql.auth.existingSecret""Existing MySQL credentials Secret.
mysql.auth.existingSecretUserPasswordKeymysql-user-passwordApplication password key.

mariadb

Bundled HelmForge MariaDB; full subchart values may be overridden.

ParameterDefaultMeaning
mariadb.enabledfalseDeploy MariaDB; requires database.type=mariadb and the other database subcharts disabled.
mariadb.architecturestandaloneStandalone or replication; the Moodle connection always targets the writable Service.
mariadb.auth.databasemoodleInitial database name.
mariadb.auth.usernamemoodleInitial application user.
mariadb.auth.password""Application password; generated by the subchart when empty.
mariadb.auth.existingSecret""Existing MariaDB credentials Secret.
mariadb.auth.existingSecretUserPasswordKeymariadb-user-passwordApplication password key.

sessions

Redis session options; independent of Moodle MUC cache mappings.

ParameterDefaultMeaning
sessions.enabledfalseUse Redis sessions; requires bundled Redis or an external Redis endpoint.
sessions.host""External Redis hostname.
sessions.port6379External Redis port.
sessions.database0Redis logical database dedicated to Moodle sessions.
sessions.prefixmoodle_session_Key prefix; isolate each Moodle installation.
sessions.existingSecret""External Redis password Secret; e

Deploy moodle with OpenTenant

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