With some experience on docker-compose, Kubernetes seems very stable, quick and reliable solution for the need of pushing a Magento 2.x project into the cloud.

There are also alternatives such as docker swarm (which has a more gengle learning curve when having docker-compose background). Willing to test multiple solutions, Kubernetes does not disappoint when doing the translation from local project into the cloud.

Things are getting up and running fast enough (reuse the existing fpm, nginx, redis, varnish images and creating some “services and pods”), they look rock solid and give you a good confidence on the final product.

The full setup so far includes:

  1. nginx ssl termination (with letsencrypt certificates),
  2. varnish for FPC,
  3. redis,
  4. nginx+fpm with autoscaling,
  5. a NFS server for sharing the necessary the data across different nodes.
  6. There is also a cron container for the application, taking care of the letsencrypt renew as well.
  7. The sql proxy container is just making the secure connection to a gcloud SQL instance, the missing part so far from the puzzle.

Magento 2.x on Kubernetes

Capistrano container to allow Magento deploys, because is a pretty addictive tool, is a work in progress.

What seems like a missing feature is the over capacity autoscaling of the minion nodes, but still looks extremely powerful without it.

EDITED (28 May 2017): Capistrano container was added in the pre-alpha version + we just switched from GCE provider to GKE and seems the autoscaling is directly related to pods waiting to be created, which is amazing:

Cluster Autoscaler periodically checks whether there are any pods waiting for a node with free resources and are not being scheduled. If such pods exist, and the Cluster Autoscaler determines that resizing a node pool would allow the pod to be scheduled, then a node pool resize is executed.

Cluster Autoscaler also monitors the usage of all nodes. If a node is not needed for an extended period of time and all of its pods can be easily scheduled elsewhere then the node is deleted.