The following example uses kine with a mysql
database for persistence.
A sample script is available to generate certs here
But you also will need to use SAN
instead of CN
We have a example of the files you will need to generate the certs for the server
We can run mysql
on a host using docker
here
you will also need the cnf
file here
docker build -t mysql-kine .
docker run --name kine-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=$PASSWORD -d mysql-kine
this will start mysql
db with everything you will need.
Run kine on the same host as mysql
database:
kine --endpoint "mysql://root:$PASSWORD@tcp(localhost:3306)/kine"
--ca-file ca.crt --cert-file server.crt --key-file server.key
This will expose the mysql
db as an etcd
endpoint.
You can use the following command to launch a k3s
server with kine.
k3s server --datastore-endpoint "mysql://root:$PASSWORD@tcp(localhost:3306)/kine"
--datastore-cafile ca.crt --datastore-certfile server.crt --datastore-keyfile server.key
And that's it! You can now use k3s
with mysql
as a db.