Skip to content

Javviviii2/Moodle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moodle and High Disponibility

Curse: ASIR 2024 School: CPIFP Alan Turin By: Javier Rodríguez Fernández

CheckPoint

Video CheckPoint

Diary

Moodle binnacle

Security Plan

Security Plan

Final Video

Video

Presentation PDF

PDF

Documentation

Requeriments

  • Kubernetes
  • Helm
  • K9s (optional but highly recommended)
  • A kubernetes cluster
  • Terraform (in case of using terraform manifest)

Moodle Imagen from Bitnami

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 Environment Variables

  • MOODLE_DATABASE_USER: Database user name. Must be the same as MARIADB_USER.
  • MOODLE_DATABASE_PASSWORD: Database user password. Must be the same as MARIADB_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 Imagen from Bitnami

MariaDB Environment Variables

  • 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).

Setting up

1. Create Google cluster

gcloud container clusters create-auto moodle --location=europe-southwest1

Also, you can use Terraform cluster manifest:

terraform init
terraform plan
terraform apply

2. Install Moodle and MariaDB

  1. Prepare secrets and namespace:
    kubectl create namespace moodle
    kubectl apply -f /path/to/secretmoodle
    kubectl apply -f /path/to/secretmariadb
  2. Moodle
    helm install moodle chart/moodle

Change value pvc.create to "true" the first time. It will create the pvc

  1. MariaDB
    helm install mariadb chart/mariadb

Change value pvc.create to "true" the first time. It will create the pvc.

Google Cloud Cluster

Connect to GKE:

gcloud container clusters get-credentials CLUSTER_NAME --zone ZONE_NAME --project PROJECT_ID

Public Moodle IP:

http://34.140.172.97:8080/

Bibliography

About

Proyecto final del GSFP ASIR 2024

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published