4 ms·
dumb question - where is the storage kept?
by justanotheratom 3y ago
dumb question - where is the storage kept?
- iamgopal 3y agoMe who have never used kubernetes, what if node crash ? Will I lost everything ?
- stanac 3y agoNo, attached storage is not part of the node (not directly). It's something like attaching external (host) directory to a docker container. Your can kill the node/pod and storage is not affected, later you can attach new pod to the same storage.
- rad_gruchalski 3y agoThe answer is: it depends. It depends on if you use persistent volumes, and how well is your pv isolated from the failed node. If done right, no data loss.
- marcosdumay 3y agoA big emphasis to the "if done right" part. You should test your setup, because it's very often not done right, and it's easy to overlook a problem.
- siamese_puff 3y agoI think people over think how hard this actually is. Data replication isn't a new concept. You can use RAID with a NAS or setup async replication with operators for things like Postgres/SQL. Obviously it's worth doing simulated disaster recovery to ensure you would recover if there is hardware failure. The larger the scale and throughput with parallel writes against the same keys, etc then the more complicated the setup will be. I hope to write more on this topic, but setting up a persistent volume with a NAS is a great way to ensure high durability.
- bo0tzz 3y agoWherever you want, Kubernetes supports basically every storage backend you can imagine.
- doublerabbit 3y ago> Kubernetes supports basically every storage backend you can imagine. Text files?
- dilyevsky 3y agoIf you can figure out how to create mount point out of it and provide your own csi driver then yes
- doublerabbit 3y agoSo that's a no then. Creating != Supporting Anything can be supported by creating your own driver.
- znpy 3y agoThe author mentions Longhorn, a storage solution from the people behind the k3s distribution, so I’m assuming the data is stored in pvc provisioned through longhorn.
- siamese_puff 3y agoOP here. In general, yes! That is correct. I am using Longhorn with K3s, it's very slick and easy to get started with. In this case, I'm using multi-replica cluster with Zalando _only_.
- siamese_puff 3y agoOP here. Currently I am using Longhorn on this cluster which does data replication on SSDs attached directly to the nodes. My backlog item is to run an external NAS with RAID. In this post specifically, the replication is handled by Zalando and not Longhorn, but the storage itself is on each node (specified by the node selector).
- cwiggs 3y agoAll the cloud providers offer a storage class for k8s. The storage class allows you to tell k8s that you want a persistent volume (PV) and it will make API calls to the cloud provider to get you a block storage device. You can tell k8s you want to use that PV in your pod and k8s will automatically mount the block storage to the worker node that your pod lives on and makes it available to the pod. OP uses Longhorn which is a whole other thing that I've only read about. For at home you can use other storage classes like ceph, NFS, etc.