-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
neonvm: continuous synchronisation of files in pod/vm #1222
Conversation
No changes to the coverage.
HTML Report |
f2456ad
to
26f66b5
Compare
open questions:
|
@conradludgate @sharnoff Have you considered instead of relying on inotify and push model to modify neonvm-daemon to subscribe for secret changes via kube-API to reduce the number of moving parts?
|
I think this inevitably has the same issue. The service account token updates in the pod, and the VM needs to notice that change |
I've looked into service accounts. They also use the same form of atomic directory updates. Currently there's no projected volume disk source for VM objects, but this is the kinda thing that could be hard-coded in the neomvm-runner code. Add |
03c3135
to
546f869
Compare
High level, feels like we need a shared file system primitive for the VMs, I keep seeing items that this would potentially solve. |
Not sure exactly what this means |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly looking good -- left a thorough review; I expect 1, maybe 2, much smaller rounds remaining
Also, could you update the PR title to have the structure component: Title
? (ordinarily the PR title format checker would catch that, but feat:
is a sufficient prefix to trick the regex 😄)
In this case, s/feat/neonvm/
would suffice, but it's up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending resolution of remaining comments -- thanks!
2583c0e
to
0aa8423
Compare
For #1213 I need the renewed certificate secret to be updated within the vm.
It's ok if there's some lag on this synchronisation as certificates are renewed with generous amount of time left until expiry.
Design:
neonvm-runner will subscribe to inotify events for a specific list of secrets. If an event is detected, the secret contents are sent in a http request to neonvm-daemon.
The files will be owned by the daemon user, and read-only by postgres.
If there's an error when uploading, then there's a secondary loop every 5 minutes to catch up, using a checksum to compare.
We mirror kubernetes and use atomicwriter to atomically update multiple files in the secret.
Useful links:
https://ahmet.im/blog/kubernetes-secret-volumes-delay/
https://ahmet.im/blog/kubernetes-inotify/
Some discussion here:
https://neondb.slack.com/archives/C03TN5G758R/p1737723555448339
https://neondb.slack.com/archives/C03TN5G758R/p1738669103059979