Node data persistence in persistent volume claims#787
Node data persistence in persistent volume claims#787Jhoyola wants to merge 8 commits intobitcoin-dev-project:mainfrom
Conversation
pinheadmz
left a comment
There was a problem hiding this comment.
Concept ACK so far, a few questions below.
It would be great if possible if you could add a test that demonstrates the data recovery. I feel like there's one step missing in the docs (see below) that I could use to test the feature.
Have you also tried the persistent volumes with a cloud provider like Digital Ocean? I'm just wondering if there's any obstacles with that. I imagine the volumes persist as long as the cluster is running.
Also - tested using Windows WSL! I know we connected on #655 already, I'm just impressed you are using windows ;-)
And finally thanks for the contribution! Your PR is clean, well organized, and the commits show understanding of the repo which is really great. Please keep in touch about how you're using Warnet at Mion and if there's anything else you need.
| - configMap: | ||
| name: {{ include "cln.fullname" . }} | ||
| name: config | ||
| - name: shared-volume |
There was a problem hiding this comment.
This can be named something more specific like cln-datadir and below, lnd-datadir. I think the reason it is called "shared volume" on main is because for lnd it is shared with circuit breaker and other containers that read the macaroons, etc. But that was a poor choice of name and we can fix it now.
| persistence: | ||
| enabled: false | ||
| storageClass: "" | ||
| accessMode: ReadWriteOnce |
There was a problem hiding this comment.
I'm not super familiar with these options, but is there a reason you chose ReadWriteOnce which is accessible by the entire kubernetes node and not ReadWriteOncePod which seems to be a bit more specific for the use case?
There was a problem hiding this comment.
I'm not very good with Kubernetes, but good suggestion, ReadWriteOncePod is better. I changed it to that.
docs/persistence.md
Outdated
| ```yaml | ||
| persistence: | ||
| enabled: true | ||
| existingClaim: "bitcoin-node-001-data" |
There was a problem hiding this comment.
How do you get the name of the claim from the last lifecycle?
There was a problem hiding this comment.
The name is decided based on tank name, namespace and node type. I added it to the documentation.
bd1886c to
e62cf6d
Compare
|
I didn't test with any cloud setup. I'm actually quite new to kubernetes and never ran it in cloud. I would imagine this works nicely there too. One thing I'm still unsure about: Now it's possible to leave the volumes intact even after I at least added a small fix for the |
src/warnet/control.py
Outdated
| inquirer.Confirm( | ||
| pvc_confirmed, | ||
| message=click.style( | ||
| "Do you also want to delete all PVCs containing persistent data? This will result in permanent loss of data.", |
e62cf6d to
bf495eb
Compare
|
Now by adding |
|
For me the ln_test passes locally on this branch so maybe there is some race condition or similar? |
Our ci is notoriously flaky, working with kubernetes has this "eventual consistency" to it which isn't easy to reproduce all the time. Anyway I restarted CI on your PR and everything looks good. I'm going to add a test myself and push to your branch (if you don't mind) then we'll be RFM. |
Thanks, yes, sounds good. |
At Torq / Mion we intend to move to using warnet for persistent regtest lightning network for development locally. This requires to have the nodes keep their state indefinetly, to not need to constantly recreate the network, connect nodes to our software etc. I tried to do it by defining
volumesandvolumeMounts, but for bitcoin core the .bitcoin directory is already mounted so it conflicted on making a new mount to the same dir. This PR aims to add built-in, easy and configurable persistence option.Overview
enabled: trueto create automatic PVC for the nodeexistingClaim: <existing-pvc-name>to use pre-created PVC instead of creating new oneTested in Windows WSL environment.