Goglides Dev 🌱

Goglides Dev 🌱 is a community of amazing users

We are working on this space so that IT professionals can grow together.

Create account Log in
Cover image for Running Magento2 in your kubernetes cluster
Sanjog Pandey
Sanjog Pandey

Posted on

Running Magento2 in your kubernetes cluster

I was trying to setup Magento for our ecommerce website. We are using bitnami privided docker image and helm chart to deploy it on kubernetes cluster. Everything was running just fine. But recently we try to integrate this with aws s3 bucket and everything started falling apart. This is what we did to resolve this problem.

We were seeing following issue,

magento 13:12:58.39 INFO  ==> Trying to connect to Elasticsearch
magento 13:12:58.40 INFO  ==> Upgrading database schema
Cache types config flushed successfully
Cache cleared successfully
File system cleanup:
FilesystemIterator::__construct(/bitnami/magento/pub/static/frontend/MageBig/martfury_layout05): failed to open dir: Permission denied
Enter fullscreen mode Exit fullscreen mode

Image description

This is how we resolve it,

First attach to magento pod as follows,

kubectl exec -it production-shop-magento-79bdf79844-fdrhm  -n production bash 
Enter fullscreen mode Exit fullscreen mode

And run following script to solve this problem, source of scripts with little modification,

cd /bitnami/magento
ls -la var/view_preprocessed/pub/static/frontend/MageBig
chmod -R 755 pub/static/frontend/MageBig/martfury_layout05
find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento
Enter fullscreen mode Exit fullscreen mode

Discussion (0)