How to check whether the k3s cluster is running with embedded etcd or SQlite or External (MySQL/PostgreSQL)
This document (000021684) is provided subject to the disclaimer at the end of this document.
Environment
K3S
Situation
How to check whether the k3s cluster is running with embedded etcd or SQlite or External (MySQL/PostgreSQL)
K3s supports the following datastore options:
- Embedded SQLite: SQLite cannot be used on clusters with multiple servers.
- Embedded etcd: Basically for HA cluster, Embedded etcd will be automatically selected if K3s is configured to initialize a new etcd cluster
- External Database; High availability DB
Resolution
- Here are the few command line options:
#journalctl -u k3s.service --no-pager | grep "database"
- If the logs show "Running embedded etcd or Defragmenting etcd database", K3s is using etcd.
- If you see references to SQLite or kine, it's using SQLite.
- There are no etcd status conditions when using kine. With kine, the datastore is always considered healthy. If the database is not available, k3s will fail to start, or exit if previously running.
2. Another option is:
# cat /etc/systemd/system/k3s.service | grep 'ExecStart'
- If the output contains --datastore-endpoint, K3s is using an external database (MySQL/PostgreSQL).
- If --datastore-endpoint is NOT set, K3s is using an embedded database which could be either SQLite (single-node) or etcd (HA mode).
3. Another option:
# ls -l /var/lib/rancher/k3s/server/db/
- If you see a file named
k3s.db
, K3s is using SQLite
4. Another option:
# etcdctl member list
- If this returns a list of members, K3s is running with embedded etcd.
Cause
faq
Additional Information
Applicable only for k3s
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.
- Document ID:000021684
- Creation Date: 30-Jan-2025
- Modified Date:06-Feb-2025
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com