Curse: ASIR 2024 School: CPIFP Alan Turin By: Javier Rodríguez Fernández
- Kubernetes
- Helm
- K9s (optional but highly recommended)
- A kubernetes cluster
- Terraform (in case of using terraform manifest)
Packages installed by Bitnami Dockerfile:
- "php-8.1.28-4-linux-${OS_ARCH}-debian-12"
- "apache-2.4.59-0-linux-${OS_ARCH}-debian-12"
- "postgresql-client-13.14.0-2-linux-${OS_ARCH}-debian-12"
- "mysql-client-11.3.2-2-linux-${OS_ARCH}-debian-12"
- "libphp-8.1.28-0-linux-${OS_ARCH}-debian-12"
- "moodle-4.4.0-0-linux-${OS_ARCH}-debian-12"
MOODLE_DATABASE_USER: Database user name. Must be the same asMARIADB_USER.MOODLE_DATABASE_PASSWORD: Database user password. Must be the same asMARIADB_PASSWORD.MOODLE_DATABASE_HOST: The host of the Moodle database.MOODLE_DATABASE_TYPE: The type of the Moodle database.MOODLE_DATABASE_NAME: The name of the Moodle database.MOODLE_USERNAME: The username for Moodle admin.MOODLE_PASSWORD: The password for Moodle admin.EXTRA_LOCALES: Additional locales to be installed in the Moodle container. Example:es_ES.UTF-8 UTF-8.
These environment variables are set using Kubernetes secrets (moodle-secret).
MARIADB_ROOT_USER: MariaDB database root user.MARIADB_ROOT_PASSWORD: MariaDB database root user password.MARIADB_USER: MariaDB database user to create during the first initialization.MARIADB_PASSWORD: Password for the MariaDB database user to create during the first initialization.MARIADB_DATABASE: MariaDB database to create during the first initialization.MARIADB_SKIP_TEST_DB: Whether to skip creating the test database.MARIADB_ENABLE_SLOW_QUERY: Whether to enable slow query logs. "1" to set.MARIADB_LONG_QUERY_TIME: How much time, in seconds, defines a slow query.
These environment variables are set using Kubernetes secrets (mariadb-secret).
gcloud container clusters create-auto moodle --location=europe-southwest1Also, you can use Terraform cluster manifest:
terraform initterraform planterraform apply- Prepare secrets and namespace:
kubectl create namespace moodlekubectl apply -f /path/to/secretmoodlekubectl apply -f /path/to/secretmariadb - Moodle
helm install moodle chart/moodle
Change value pvc.create to "true" the first time. It will create the pvc
- MariaDB
helm install mariadb chart/mariadb
Change value pvc.create to "true" the first time. It will create the pvc.
Connect to GKE:
gcloud container clusters get-credentials CLUSTER_NAME --zone ZONE_NAME --project PROJECT_ID- Moodle:
- MariaDB
- Kubernetes and Helm:
- Google Cloud