Kubernetes php web app with mysql and storing uploaded images

3/7/2019

I've developed a web app for a client, and want to be able to use Kubernetes so it can be scaled as there will be a reasonable amount of users.

I'm a Kubernetes noob and am getting a bit stuck/going round in circles.

The web app is written in PHP, connects to a MySQL database, and users can upload pictures. How should I structure this? Many thanks in advance.

-- Gaius T
kubernetes
php

2 Answers

3/8/2019

I assume, mysql is deployed at any physical host and you want to run multiple PHP containers. I have one query on how to store images across multiple PHP instances. You can create PHP docker image and deploy on k8s using deployment. The uploaded files need to be written on mounted host path so these are persisted in case of container failure. According to usecase, the uploaded images need to be sync the uploaded files at central place.

-- Akash Sharma
Source: StackOverflow

3/8/2019

As stated above you should be able to find a lot of resources online about this topic. As u mentioned you are new to Kubernetes so as cookiedough mentions you should spend some time on learning and testing this. You can do that in local machine using for example minikube. Other than that learn about deployments, services and auto-scaling in Kubernetes. You can find great tutorials and labs in the official documentation:

If you will approach any problems during that process feel free to write a new question on stack with description what exactly went wrong and what steps led to that.

-- aurelius
Source: StackOverflow