Kubernetes Deployment for stateful application

8/28/2018

I have a question about best practices designing deployments and or stateful sets for stateful applications like wordpress and co. The current idea i had was to make a fully dynamic image for one specific cms. With the idea i can mount the project data into it. Like themes, files etc. In the case of wordpress it would be wp-content/themes. Or is that the wrong way. Is it better to already build the image with the right data and dont worry about the deployment because you already have everything.

What are your experiences with stateful apps and how did you solve those "problems".

thanks for answers :)

-- Melvin
deployment
docker
google-kubernetes-engine
kubernetes
web-deployment

2 Answers

8/28/2018

All you need to run (wp-content/themes) app it would be nice to put in an image. All that will change (statefull) you can store in the PVC.

-- Arslanbekov
Source: StackOverflow

8/28/2018

I don't think Wordpress is really stateful in this matter and it should be deployed like a regular deployment.

Stateful Set is typically things like databases that needs storage. As an example, Cassandra would typically be a Stateful Set with mounted Volume Claims. When one instance dies, a new one is brought up with the same name, IP address and volume as the old one. After a short while it should be part of the cluster again.

With deployments you will not get the same name or IP address and you can't mount Volume Claims.

-- Andreas Wederbrand
Source: StackOverflow