k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.02k stars 2.35k forks source link

CRDT based Control Plane State #5347

Closed malarinv closed 2 years ago

malarinv commented 2 years ago

Is your feature request related to a problem? Please describe.

Etcd being a strongly consistent kv store, it compromises on availability for edge use-cases, A lightweight eventually consistent control-plane state storage based on CRDTs could make k0s much more scalable and efficient.

Describe the solution you'd like

Well described in this paper https://dl.acm.org/doi/pdf/10.1145/3434770.3459730

Describe alternatives you've considered

All other solutions aren't as performant(claimed) as the CRDT based solution

Additional context

This could be an unique/special feature of k3s :wink: I am not the author of the paper just found it to be an interesting read which might improve k3s/k0s. So here I am.

Backporting

brandond commented 2 years ago

That paper seems to be long on analysis but short on actual actionable conclusions. Is there a particular library or implementation of the suggested alternative datatype available to consume? Is this something that should be implemented within Kubernetes as an alternative datastore engine, or should it still expose an etcd-like API as Kine does?

malarinv commented 2 years ago

Not aware of a library that exposes a storage interface but the json crdt part seems to be covered by https://github.com/gpestana/rdoc. it is an implementation of https://arxiv.org/abs/1608.03960 [27]th reference on the original paper.

malarinv commented 2 years ago

The actual persistence service which uses Json CRDT probably has to be implemented. The design might be similar to Kine, except using a kubernetes hosted Json CRDT store rather than an external SQL store.

Edit: OrbitDB seems like a good candidate Edit2: More implementations at https://crdt.tech/implementations#distributed-databases

brandond commented 2 years ago

You might take a look at https://github.com/k3s-io/kine/pull/115

stale[bot] commented 2 years ago

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 180 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.