Hi everybody!
Hi Eduard,
Do you have some of your implementation for this viewable somewhere? I'm really interested in your redis config, as well as your image builds.
I'm also curious how you've worked around https://tracker.moodle.org/browse/MDL-63770
Cheers!
Eugene.
Hello everybody... maybe it can help...
https://wiki.geant.org/display/NE/Managing+and+running+large+scale+Moodle+system%2C+for+IT
There you will find a presentation made by Eduard Cercós about this topic.
I would like to thank all your comments and linking to my presentation. Although you may have work it out, I'd try to answer your questions to help any one else coming to this forum.
- After over a year running in kubernetes we're very happy with this changes. As we stated main benefits are stability and scalability. The upgrades are integrated in our CI/CD pipelines and any change without database upgrading is deployed without downtime.
- Major pains are external to kubernetes and shared with any large scale installation. One we hit was the interference with other services (solved using resource limiting) and another one was the usage of some storage classes (like EBS) that can take some time to attach/detach (solved using shared filesystems like EFS).
- We recently included a ReadinessProbe which prevents faulting pods to be used. It has reduced the downtime in stress situations and helped to solve some DoS attacks we faced recently. But it may lead to some 'There something wrong with internet' temporary errors. We're still working on it
- What we really love about k8s is how easily you can add services with very little setup. For example we use a standard image of Redis without any special changes. Its pod has a memory limit so when it's passed, the instance is silently restarted and all its content flushed. This is just for the cache instance, as session instance could lead to some errors while restarting (as it happened recently)
- Related with https://tracker.moodle.org/browse/MDL-63770, we have no problem there as external and internal ports where all standard (443 & 80) All intermediate ports used inside the cluster by its elements (proxies, services, etc) are never seen by Moodle. Also, k8s uses a virtual network so you can have multiple services using the same port.
Hope it helps! If any other question I'll try to answer as soon as possible
Hii Eduard, thank you for all the comment . It was really helpful.
I wanted to know more about the docker images that you are using . As I already say you video and presentation and there you have mention that you are building your own image and not using the bitnami one .We were using bitnami image and it works fine but when we are going in the HA(high availability ) mode and trying to run multiple pods we faced some issue with moodle version 3.9 and older(this was the issue) , so in the issue you can see that there was some problem with the session directory when we try to launch moodle in HA mode by specifying ENV variable MOODLE_SKIP_BOOTSTRAP="yes".
So that I will skip the population of database as it was already population when we launch the single moodle instances.
Now bitnami image version 3.10 and 3.11 works fine as it was fix after that issue was raised, but as we are looking to use other older version (2.7 +) so we will not be able to support HA using bitnami image . We need to create our own image (i might be wrong here).
Can you shared some light how can we do that ?
Also I did check out this 2 issue:
You can create a docker image easily following any Docker file, or docker-compose, etc. If you never create one before I'd recommend to take a look to official Docker documentation here (https://docs.docker.com/get-started/). Here it is one Dockerfile similar to the ones we use to create a moodle site:
COPY /build/setup.sh /tmp/setup.sh
COPY /build/scripts /opt/scripts/
COPY /build/deploy_key.pri /root/.ssh/id_rsa
COPY /build/cron.json /opt/crons/cron.json
COPY /build/default.conf /etc/nginx/includes/default.conf
RUN bash /tmp/setup.sh
VOLUME ["/opt/app"]
VOLUME ["/opt/data"]
VOLUME ["/opt/logs"]
EXPOSE 80
CMD ["/bin/bash", "/opt/scripts/run.sh"]
I'm currently working on a custom bitnami moodle image. why bitnami? because they have all the scripts needed for deployment and I don't really want to reinvent the wheel and they have a helm chart that I slightly modifiedand deploy with argocd.
However, I have questions regarding your kubernetes deployment:
How do you handle the upgrade? I would like to be able to do it by updating the image and not manually inside the container and especially how do you manage the reinstallation of the plugins?
thank you for your reply
Karim
It is time somebody carefully analyze the Bitnami Docker image for Moodle. It pops up sporadically in the forums and do not get useful answers, because it is so much different from the native installation of Moodle on LAMP and as a result the advice the regulars here do not apply.
In a recent workshop the Moodle Bitnami Docker and the plain vanilla LAMP installation on VPS came up site-by-side. Yes, the Docker image was installed and running in minutes. But as the workshop progressed, as people started upgrading, installing plug-ins, taking backups, etc., on the Bitname-Docker front there were always discussions about Docker and Bitnami whereas on the VPS front, there was nothing to discuss. Halfway though we swapped the Bitnami with a hand-made Docker image starting from Ubuntu Linux Server, but it came too late to undergo the same scrutiny.
P.S. @Moderator: I propose to move this whole discussion to Installing and Upgrading help forum. This has nothing to do with performance. (I know, there are claims that this system is efficient and scalable. But this thread has no evidence, no load tests nor numbers supporting it. It is still about (easily) _installing_ Moodle.)
That's the problem - everybody who creates Docker (or Bitnami or whatever) installations for Moodle is building it for their own requirements - or at least some specific requirement - and therein lies the problem. So if you use my Docker install (help yourself) and it all goes wrong then you need to ask me, not these forums. And don't bother, because I'm too lazy to answer
I wouldn't say using your own docker image is reinventing the wheel as using a customized SO installation isn't, is it? I found really useful adapt your containers to your needs and simplify the overall maintenance and upgrading process.
As we add the code to the image, we have a pipeline process that once the code is upgraded (including the desired plugins) the docker image is rebuilt. Once deployed, we launch the upgrade process (either manually or automatically) to finish the changes in the database.