moodle
by HelmForge
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
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 93.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.
| Parameter | Default | Meaning |
|---|---|---|
nameOverride | "" | Override the chart name. |
fullnameOverride
Override resource names.
| Parameter | Default | Meaning |
|---|---|---|
fullnameOverride | "" | Override resource names. |
commonLabels
Additional resource labels; selector labels are reserved.
| Parameter | Default | Meaning |
|---|---|---|
commonLabels | {} | Additional resource labels; selector labels are reserved. |
commonAnnotations
Annotations added to all resources created by this chart; resource-specific annotations take precedence.
| Parameter | Default | Meaning |
|---|---|---|
commonAnnotations | {} | Annotations added to all resources created by this chart. |
replicaCount
Number of web pods; multiple replicas require RWX and Redis sessions.
| Parameter | Default | Meaning |
|---|---|---|
replicaCount | 1 | Number of web pods; multiple replicas require RWX and Redis sessions. |
image
Official PHP/Apache runtime, separately pinned from the Moodle code.
| Parameter | Default | Meaning |
|---|---|---|
image.repository | docker.io/moodlehq/moodle-php-apache | Image repository; custom images must contain the same PHP/Apache tools. |
image.tag | 8.4-bookworm | Human-readable PHP variant; digest pins the actual bytes. |
image.digest | sha256:922af51668352004b4255cdc1f726a63f0cee7c1354eaf66dd8d5f2c7cc379b5 | Multi-architecture manifest digest. |
image.pullPolicy | IfNotPresent | Container image pull policy. |
imagePullSecrets
Registry credentials.
| Parameter | Default | Meaning |
|---|---|---|
imagePullSecrets | [] | Registry credentials. |
source
Immutable Moodle code distribution, prepared once per pod.
| Parameter | Default | Meaning |
|---|---|---|
source.mode | archive | archive downloads a verified release; image copies code baked into image.path. |
source.url | https://download.moodle.org/download.php/direct/stable502/moodle-5.2.2.tgz | Official release archive or an HTTPS mirror of identical bytes. |
source.sha256 | 72be209e7c0f5341b87de0bc993b2430087fda2769d8c3cc2f32736d1513e88c | SHA-256 of the archive; verified before extraction. |
source.imagePath | /opt/moodle | Source directory in a custom image when mode=image. |
source.downloadTimeout | 180 | Maximum HTTPS download time per attempt in seconds. |
moodle
Moodle application settings.
| Parameter | Default | Meaning |
|---|---|---|
moodle.wwwroot | http://localhost:8080 | Public URL without trailing slash. Set the real HTTPS URL in production. |
moodle.siteName | Moodle Learning Platform | Full site name used only on first installation. |
moodle.shortName | Moodle | Short site name used only on first installation. |
moodle.language | en | Installation language. Non-English language packs require upstream egress. |
moodle.adminUser | admin | Administrative 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.existingSecretPasswordKey | admin-password | Bootstrap secret password key. |
moodle.autoInstall | true | Enable automated first installation into an empty application database. |
moodle.sslProxy | false | Allow TLS termination at a trusted proxy; pair with HTTPS wwwroot. |
moodle.reverseProxy | false | Enable only when proxy rewrites Host; ordinary Ingress preserves Host. |
moodle.disableUpdateAutodeploy | true | Disable browser-based plugin installation and code updates. |
moodle.noEmailEver | false | Disable outgoing email, useful in restored or staging environments. |
moodle.timezone | UTC | Site 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.
| Parameter | Default | Meaning |
|---|---|---|
database.type | postgresql | Backend: 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.port | 0 | External database port; zero selects 5432 for PostgreSQL or 3306 for MySQL/MariaDB. |
database.name | moodle | External database name. |
database.username | moodle | External database user. |
database.existingSecret | "" | External database password Secret, required when all database subcharts are disabled. |
database.existingSecretPasswordKey | password | Password key in the external Secret. |
database.prefix | mdl_ | Moodle table prefix; at most ten alphanumeric/underscore characters. |
database.sslMode | prefer | PostgreSQL libpq SSL mode; use verify-full with a CA for external PostgreSQL. |
database.mysqlSslMode | disable | MySQL/MariaDB TLS mode: disable, require (encryption only), or verify-full (CA and hostname). |
database.collation | utf8mb4_unicode_ci | MySQL/MariaDB collation; Unicode utf8mb4 is required for full Moodle character support. |
database.tlsSecret | "" | Optional Secret containing the database CA certificate. |
database.tlsCAKey | ca.crt | CA certificate key in database.tlsSecret. |
database.connectTimeout | 180 | Maximum wait for authenticated DB connectivity and installer lock. |
postgresql
Bundled HelmForge PostgreSQL; full subchart values may be overridden.
| Parameter | Default | Meaning |
|---|---|---|
postgresql.enabled | true | Deploy PostgreSQL. |
postgresql.architecture | standalone | Standalone or replication; external database is recommended for managed HA. |
postgresql.auth.database | moodle | Initial database name. |
postgresql.auth.username | moodle | Initial application user. |
postgresql.auth.password | "" | Application password; generated by the subchart when empty. |
postgresql.auth.existingSecret | "" | Existing PostgreSQL credentials Secret. |
postgresql.auth.existingSecretUserPasswordKey | user-password | Application password key. |
mysql
Bundled HelmForge MySQL; full subchart values may be overridden.
| Parameter | Default | Meaning |
|---|---|---|
mysql.enabled | false | Deploy MySQL; requires database.type=mysql and the other database subcharts disabled. |
mysql.architecture | standalone | Standalone or replication; the Moodle connection always targets the writable Service. |
mysql.auth.database | moodle | Initial database name. |
mysql.auth.username | moodle | Initial application user. |
mysql.auth.password | "" | Application password; generated by the subchart when empty. |
mysql.auth.existingSecret | "" | Existing MySQL credentials Secret. |
mysql.auth.existingSecretUserPasswordKey | mysql-user-password | Application password key. |
mariadb
Bundled HelmForge MariaDB; full subchart values may be overridden.
| Parameter | Default | Meaning |
|---|---|---|
mariadb.enabled | false | Deploy MariaDB; requires database.type=mariadb and the other database subcharts disabled. |
mariadb.architecture | standalone | Standalone or replication; the Moodle connection always targets the writable Service. |
mariadb.auth.database | moodle | Initial database name. |
mariadb.auth.username | moodle | Initial application user. |
mariadb.auth.password | "" | Application password; generated by the subchart when empty. |
mariadb.auth.existingSecret | "" | Existing MariaDB credentials Secret. |
mariadb.auth.existingSecretUserPasswordKey | mariadb-user-password | Application password key. |
sessions
Redis session options; independent of Moodle MUC cache mappings.
| Parameter | Default | Meaning |
|---|---|---|
sessions.enabled | false | Use Redis sessions; requires bundled Redis or an external Redis endpoint. |
sessions.host | "" | External Redis hostname. |
sessions.port | 6379 | External Redis port. |
sessions.database | 0 | Redis logical database dedicated to Moodle sessions. |
sessions.prefix | moodle_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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmoodle is pinned at v1.2.3 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