'mysql scaling on Kubernetes
I am running Kubernetes cluster and NodeJS app in it. I want to setup mysql in the way it could scale. Kubernetes provides documentation on how to run a Replicated Stateful Application. In this case it is possible to implement single master and multi slave architecture for mysql, what leads me to several concerns.
We are limited to a single master pod for write operations. What will happen if there will be a lot of write requests, and it will exceed the highest tear of resources, that my provider has? Is there is a way to scale mysql horizontally?
From documentation:
Note that only read queries can use the load-balanced Client Service. Because there is only one primary MySQL server, clients should connect directly to the primary MySQL Pod (through its DNS entry within the Headless Service) to execute writes.
Does it mean that my application have to connect to 2 mysql endpoints, one for write/read operations, and other for read only? Is there is a way to keep one endpoint?
- How Kubernetes will behave if master pod dies? How I could avoid or minimize downtime for write operations, in case of crash?
Maybe there are any other solutions to run mysql on Kubernetes besides this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
