I’m kubernetes newbie, I started to learn about K8S and I have read many docs from AKS and GKE recently , I have a lot of questions , I look forward to hearing from your experience .
Let’s say my application consists of :
- Web service : nginx
- Some custom configuration in /etc/nginx/nginx.conf
- Virtual host configs at /etc/nginx/conf.d : websiteA.conf , websiteB.conf
- Source code at /var/www/html/websiteA , /var/www/html/websiteA
How can I migrate it to K8S ?
1.1 Package nginx + /var/www/html/websiteA, /var/www/html/websiteA to images ?
Deploy images to K8S , ci/cd will rebuild image every time new release ?
1.2 Deploy a nginx deployment , mount a PVC to /var/www/html , sync websiteA and websiteB source code to volume somehow ?
How can I customize nginx config deployment ?
1.2.1 create configmap from my onpremise /etc/nginx/* and apply to nginx deployment ?
1.2.2 mount a PVC to /etc/nginx and sync config to volume somehow ?
php-fpm service, I used 7.2 and 7.4 . Do I need to mount /var/www volume to php-fpm deployments ?
MySQL : I know I should use cloud database products but has anyone deploy MySQL containers for production ? Let me know your experience :
- Mount PVC to /var/lib/mysql , sync data from on premise to volume somehow
- Customize MySQL config with configmap
- How to backup/restore data ? I think I need to include mysql-client and crond image in deployment.