LMS Moodle Operator
LMS Moodle Operator is a meta operator to automate the deployment and management of Moodle instances in Kubernetes, refered as LMSMoodle resources. It handles the full stack required to run them: Postgres, Keydb, NFS-Ganesha, and Moodle. Those components have their own Operators. In addition, a LMSMoodleTemplate custom resource is provided. It is like a template that can be reused when creating a LMSMoodle resource.
Key Technologies:
- Kubernetes
- Operator SDK
- Moodle
- Postgres
- Keydb
- NFS Ganesha
Prerequisites
- Moodle Operator: For automated provisioning and configuration of the web layer: php-fpm, nginx, cronjob, among other resources.
- Postgres Operator (Optional): For deployment and management of PostgreSQL database.
- NFS Operator (Optional): For deployment and management of shared storage using NFS Ganesha.
- Keydb Operator (Optional): For deployment and management of compatible Redis database: Keydb.
Installation
Important Note: This LMS Moodle Operator is currently in Beta stage. Proceed with caution in production deployments.
To install this this operator along all its required and optional prerequisites, follow these steps:
- Install Operator:
kubectl apply -k https://github.com/krestomatio/lms-moodle-operator/config/operators?ref=v0.6.1
- Configure a LMSMoodleTemplate:
- Download and modify this
LMSMoodleTemplatesample file to define a lms moodle template. ALMSMoodleTemplatecan be use by one or manyLMSMoodleresources as spec template.
curl -sSL 'https://raw.githubusercontent.com/krestomatio/lms-moodle-operator/v0.6.1/config/samples/lms_v1alpha1_lmsmoodletemplate.yaml' -o lms_v1alpha1_lmsmoodletemplate.yaml
# modify lms_v1alpha1_lmsmoodletemplate.yaml
- Deploy the LMSMoodleTemplate:
- Deploy Moodle
LMSMoodleTemplateusing the modified configuration:
kubectl apply -f lms_v1alpha1_lmsmoodletemplate.yaml
- Configure a LMSMoodle:
Note:
LMSMoodleresource specification has precedence overLMSMoodleTemplatespecification.
- Download and modify this sample file to reflect your specific
LMSMoodlestack configuration options. This file defines the desired state for your instance and all its layers handle by the operators. Note that it references aLMSMoodleTemplateresource by its name. TheLMSMoodleTemplateresoure in the previous step.
curl -sSL 'https://raw.githubusercontent.com/krestomatio/lms-moodle-operator/v0.6.1/config/samples/lms_v1alpha1_lmsmoodle.yaml' -o lms_v1alpha1_lmsmoodle.yaml
# modify lms_v1alpha1_lmsmoodle.yaml
- Deploy the LMSMoodle:
- Deploy a Moodle
LMSMoodleusing the modified configuration:
kubectl apply -f lms_v1alpha1_lmsmoodle.yaml
- Monitor Logs:
- Track the LMS Moodle Operator logs for insights into the deployment process:
kubectl -n lms-moodle-operator-system logs -l control-plane=controller-manager -c manager -f
- Monitor the status of your deployed
LMSMoodleinstance:
kubectl get -f lms_v1alpha1_lmsmoodle.yaml -w
Uninstall
- Delete LMSMoodle:
# Caution: This step leads to data loss. Proceed with caution.
kubectl delete -f lms_v1alpha1_lmsmoodletemplate.yaml
- Delete LMSMoodleTemplate:
# Caution: This step leads to data loss. Proceed with caution.
kubectl delete -f lms_v1alpha1_lmsmoodle.yaml
- Uninstall the Operator:
kubectl delete -k https://github.com/krestomatio/lms-moodle-operator/config/operators?ref=v0.6.1
Configuration
LMSMoodleTemplate and LMSMoodle custom resources (CRs) can be configure via their spec field: check API Reference for the respective documentation.
Contributing
- Report bugs, request enhancements, or propose new features using GitHub issues.