Query DQLIte DB

Hi

Is there a way to connect to and query the Dqlite db used when Microk8s is running as a HA Cluster from a terminal on one of the nodes ?

As I would like to see the structure of the data within the DB

Thanks in Advance

You can try this

$ /snap/microk8s/current/bin/dqlite -s file:///var/snap/microk8s/current/var/kubernetes/backend/cluster.yaml -c /var/snap/microk8s/current/var/kubernetes/backend/cluster.crt -k /var/snap/microk8s/current/var/kubernetes/backend/cluster.key -f json k8s
dqlite> select * from kine;

To exit Ctrl + D

Hi
Thanks very much i can connect now

A follow up question

What query do i need to run to establish which node in my three node cluster is currently the leader ?

Many Thanks

Try this.
/snap/microk8s/current/bin/dqlite -s file:///var/snap/microk8s/current/var/kubernetes/backend/cluster.yaml -c /var/snap/microk8s/current/var/kubernetes/backend/cluster.crt -k /var/snap/microk8s/current/var/kubernetes/backend/cluster.key -f json k8s .leader

Perfect Thanks very much