Magento 2 on Kubernetes - how do I do that?

Magento 2 on Kubernetes - how do I do that?

In this article, we’ll take a closer look at what it takes to run Magento 2 on Kubernetes. Let’s dive in!

This article assumes you have the fundamental knowledge of operating Magento 2, containers (Docker), and basic concepts of Kubernetes.

[…]

But first, we need to go through some of the aspects one needs to consider when running any PHP web application on Kubernetes, to shed light on some architectural choices done in this article.

There are different patterns for deploying a PHP web application on Kubernetes – from single-process, single-container through multi-process containers to multiple single-process ones.

[…]

It’s ok to have multiple processes but to get the most benefit out of Docker, avoid one container being responsible for multiple aspects of your overall application. You can connect multiple containers using user-defined networks and shared volumes.

[…]

On the one hand, single-process Apache+PHP containers are easier to manage, on the other NGINX has a reputation for its superior performance when serving static content, and putting it and PHP-FPM on separate pods allows you to scale them independently. Even so, this scalability comes at the cost of higher complexity, so it’s always best to run benchmarks yourself, taking factors such as expected traffic patterns, CDN use, caching into consideration.

[…]

As discussed above, we’ll use a Docker image based on php:7.2-fpm and a plain NGINX:mainline image.

[…]

One of the features of Magento 2 is the ability to pick up settings from the environment – setting an environment variable like

[…]