K3s: how does K3S support the watch mechanism under K8S after using Sqlite3?

Created on 1 Mar 2019  路  5Comments  路  Source: k3s-io/k3s

Does Sqlite3 support a watch mechanism similar to etcd? If Sqlite3 does not support the watch mechanism itself, how does K3S support the watch mechanism under K8S after using Sqlite3? Thank you!

Most helpful comment

There's a distributed relational database built on SQLite - rqlite.

All 5 comments

sqlite3 is fully in memory so it quite simple to know when something has changed. So we just monitor all mutations and fire events. Additionally the way the data is stored in sqlite is effectively a log which is how we can replay history. Full code here. It's really quite simple https://github.com/ibuildthecloud/kvsql/tree/master/clientv3/driver

Since sqlite3 does not support HA, etcd needs 3 nodes. Can you replace etcd or sqlite3 with postgresql, provide master/slave HA with 2 nodes, and implement the watch mechanism? Thank you!

There's a distributed relational database built on SQLite - rqlite.

Rqlite uses Raft to achieve consensus across all the instances of the SQLite databases. This means that at least 3 nodes are needed, and HA is not available at 2 nodes.

@jamesxia20181001 We will eventually support postgresql and/or mysql for a datastore. Right now we do not because there are other issues with HA that prevent it from fully working properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wpwoodjr picture wpwoodjr  路  3Comments

e-nikolov picture e-nikolov  路  3Comments

ewoutp picture ewoutp  路  4Comments

giezi picture giezi  路  3Comments

gilkotton picture gilkotton  路  3Comments