Debian 12 - Set Up MariaDB Database For K3s
Below are the steps I used to set up a database server for my Kubernetes cluster.
Related Posts
Resources
For my setup, I am using a VPS with 1 GB of RAM and 2 vCPUs.
Steps
Log into the database as the root user.
Create a database for kubernetes to use.
Create a user for Kubernetes to connect to the database with:
Now give the Kubernetes user full access to the Kubernetes database:
Now you are all done, exit the MariaDB CLI interface:
Allow Remote Access
By default, MariaDB only allows local connections, and does not listen to the outside world. We need to change this so that our Kubernetes servers can connect. Copy and paste the following commands which will update the server configuration for you so that the database will listen to the outside world by commenting out the bind address.
Now restart the database service for the changes to take effect:
First published: 13th January 2025