Restore k3s from MySQL dump
This document (000020803) is provided subject to the disclaimer at the end of this document.
Environment
k3s with an external database MySQL (this has been tested using Azure MySQL)
Situation
MySQL DB dump is available, and the cluster token from /var/lib/rancher/k3s/server/token
Resolution
- In the new MySQL instance create a database
- Here we set the Character set to latin1 and collation to latin1_swedish_ci, as the original DB
- we also chose the same name, as it is a new instance
- Restore the dump, you may use mysql db_name < backup-file.sql
- on the first node start k3s with:
- curl -sfL https://get.k3s.io | sh -s - server --token
--datastore-endpoint="mysql:// : @tcp( .mysql.database.azure.com:3306)/ ?tls=true" - the token is retrieve from the failed cluster in /var/lib/rancher/k3s/server/token
- Remove the failed nodes running:
- k3s kubectl get nodes
- k3s kubectl delete nodes
- Join any additional node using the instructions from k3s documentation
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.