diff --git a/README.md b/README.md index a37c5df..d5920d8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ when it's also managing HTTPS certs, so a future version of this chart could off service or use another ingress controller like nginx+cert-manager. (Note that the author tried using the Caddy Ingress Controller but it was too immature and buggy.) + ## Central Database/Monitoring/etc In the future, this chart could also be made to install monitoring, databases, ElasticSearch, or other shared resources @@ -132,7 +133,27 @@ of the box. ---------------- -## Appendix A: how to uninstall this chart +## Configuration + +### Multi-tenant Elasticsearch + +Tutor creates an Elasticsearch pod as part of the Kubernetes deployment. Depending on the number of instances +Memory and CPU use can be lowered by running a central ES cluster instead of an ES pod for every instance. + +To enable set `elasticsearch.enabled=true` in your `values.yaml` and deploy the chart. + +For each instance you would like to enable this on, set the configuration values in the respective `config.yml`: + +```yaml +K8S_HARMONY_ENABLE_SHARED_ELASTICSEARCH: true +RUN_ELASTICSEARCH: false +``` + +- And create the user on the cluster with `k8s harmony create-elasticsearch-user`. +- Rebuild your Open edX image `tutor images build openedx`. +- Finally, redeploy your changes: `tutor k8s start && tutor k8s init`. + +## Appendix : how to uninstall this chart Just run `helm uninstall --namespace tutor-multi tutor-multi` to uninstall this. diff --git a/tutor-contrib-multi-plugin/tutor_multi_k8s_plugin/commands.py b/tutor-contrib-multi-plugin/tutor_multi_k8s_plugin/commands.py index 1d53ff6..643d019 100644 --- a/tutor-contrib-multi-plugin/tutor_multi_k8s_plugin/commands.py +++ b/tutor-contrib-multi-plugin/tutor_multi_k8s_plugin/commands.py @@ -14,7 +14,7 @@ def harmony(context: click.Context) -> None: @click.command(help="Create or update Elasticsearch users") @click.pass_obj -def create_user(context: click.Context): +def create_elasticsearch_user(context: click.Context): """ Creates or updates the Elasticsearch user """ @@ -41,4 +41,4 @@ def create_user(context: click.Context): ) -harmony.add_command(create_user) +harmony.add_command(create_elasticsearch_user) diff --git a/tutor-multi-chart/values.yaml b/tutor-multi-chart/values.yaml index 6e7a9f9..164befc 100644 --- a/tutor-multi-chart/values.yaml +++ b/tutor-multi-chart/values.yaml @@ -69,8 +69,11 @@ elasticsearch: enabled: false # Operators will need to add/update the following setting in each - # of their instances by running the `tutor harmony create-user` - # + # of their instances by running the commands: + # ``` + # tutor config save --set K8S_HARMONY_ENABLE_SHARED_ELASTICSEARCH=true --set RUN_ELASTICSEARCH=false + # tutor harmony create-elasticsearch-user + # ``` # RUN_ELASTICSEARCH: false # ELASTICSEARCH_PREFIX_INDEX: "username-" # MULTI_K8S_USE_SHARED_ELASTICSEARCH: true