Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Don't make MySQL a Pet or put it on NFS #109

Open
2 tasks
geerlingguy opened this issue Jun 6, 2018 · 5 comments
Open
2 tasks

Don't make MySQL a Pet or put it on NFS #109

geerlingguy opened this issue Jun 6, 2018 · 5 comments

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented Jun 6, 2018

Originally, I used nodeAffinity with the MySQL PV to restrict it to kube5, and I added a taint to the MySQL Deployment to only deploy to kube5 as well. Then I switched it to use an NFS PVC so I could remove the taint and make things not as fragile... but then I typed this note to myself:

Don't ever run MySQL on NFS. Not even once. Wow. It... works. But slow doesn't even begin to describe the experience.

The holy grail would be some sort of MySQL replication setup where:

  • MySQL doesn't care what node it's running on.
  • MySQL doesn't rely on instance-based storage (so is not tied to a particular instance).
  • Drupal doesn't care about masters and replicas or particular nodes; it just points at a MySQL endpoint.
  • You can delete the MySQL master pod/container and there might be a minute or two of downtime, but a new master pops up in its place.

I was intrigued by this MySQL on Autopilot blog post, specifically:

The autopilot pattern is an approach to application and infrastructure design that pushes automation for each component of our systems into the application. Each container that makes up the application has its own lifecycle, and we package those lifecycle behaviors into the application container rather than relying on external infrastructure.

See also: https://github.com/autopilotpattern/mysql

@geerlingguy
Copy link
Owner Author

It might be too complex to handle inside this particular project... but having this project around means I can tinker with getting the pattern working inside Kubernetes.

@geerlingguy
Copy link
Owner Author

So I just moved MySQL's database PV from localStorage to a NFS PVC, which will allow the MySQL server to run on any node with persistence.

But I have been digging further on this topic for other projects, and found a couple interesting MySQL Operators for Kubernetes which may be able to work for this:

Whether I can get them working with RPi/ARM/32 bit is another matter...

@geerlingguy geerlingguy changed the title Don't make MySQL a Pet Don't make MySQL a Pet or put it on NFS Dec 25, 2018
@onedr0p
Copy link

onedr0p commented Jul 9, 2019

You should take a look at spinning up a GlusterFS cluster for persistent data. It even has an API for Kubernetes called Heketi.

I have a 3 node Pi4 cluster set up and it's pretty neat. I had to compile glusterfs version 6 on each of my Pi's because the packaged one is too old for Heketi. I'll publish my ansible roles if you want to take a look.

Your containers can be HA, why not the data :)

@stale
Copy link

stale bot commented Mar 6, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Mar 6, 2020
@stale
Copy link

stale bot commented Mar 25, 2020

This issue is no longer marked for closure.

@stale stale bot removed the stale label Mar 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants