How to autoscale database read only nodes?

Posted December 3, 2020 535 views
KubernetesDigitalOcean Managed KubernetesDigitalOcean Managed MySQL Database

Hi all!,

There is any way to add a new read only node in a MySql managed database with the kubernetes autoscaler?

Seems very easy to setup an autoscaler with DigitalOcean web UI for k8, but I didn’t find any option for databases.

Is there any way for that in “kubernetes dashboard”?

If not… Should I implement a custom solution with a node that monitors the cluster, so it adds/removes read only replicas using DigitalOcean API?

By the way, I’ve tested my application and it works with several read only nodes, and multiple php nodes as well… It works even adding & remove read ddbb replicas & php nodes.

Many thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @MassiveGreenBlueStarfish,

This sounds like a really solid setup!

Regarding your question, I don’t believe that this is available from the Kubernetes dashboard directly.

But indeed you could use doctl or the API to automate this.

Here is how you could add new replicas with doctl:

And here’s how to do that via the API:

Hope that this helps!