This is a test of an idea to use local persistent volumes and initContainers for rebuilding the MW l10n cache during deployment instead of including the caches in the image itself.
setup.sh
Running setup.sh
should get you a two-worker node k8s cluster running
locally along with a local image registry and a built multiversion image.
kubectl apply -f mediawiki.yaml
Running this command should create a deployment for MediaWiki of 6 pods that uses an init container to rebuild the l10n cache.
The init container uses a file lock to ensure that only one rebuild process is
running on each node which should work properly on the local storage backed
persistent volume. Verify this during the deployment by attaching to a
node docker container and running top (you can see both processes even though
they're separate nodes because this is using kind
and the nodes are within
the same VM).
docker exec -it test-local-pvs-worker top