-
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: create a Certificate object for each VM #1213
Conversation
7f8372b
to
e9121eb
Compare
No changes to the coverage.
HTML Report |
4592eb0
to
13ed571
Compare
|
Yeah - when paired with the other PR, yes it does reload as expected. Still needs work to make postgres to recognise the change, but yes it should work |
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.
Initial review -- lots of comments, but overall looks ok enough.
I didn't look at doReconcileCertificateSecret
very deeply, figured I'd wait until after refactoring
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 poll the files every 30s and compare a checksum against the files in the VM, via neonvm-daemon. If the checksums do not match, they are sent to neonvm-daemon where neonvm-daemon utilises atomic-writer to update the files. 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
901832a
to
8b3d229
Compare
Sorry, may be it was previously discussed, but are there more context on that statement? It's a bit unclear which design decision is in question |
A design decision by cert-manager.io https://cert-manager.io/docs/usage/certificate/#cleaning-up-secrets-when-certificates-are-deleted
Enabling this flag cluster wide would fix things for neonvm, but the outcome is not ideal for our other services that rely on cert-manager. |
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.
Looking good. I think it'll probably need one more pass, and then be good to go.
cc @mikhail-sakhnov or @Omrigan, might be worthwhile to double-check my comments here
I think one of the options as well is to have a controller for secrets to clean them up, if they orpaned, instead of re-wrtiting cert manager logic. |
e11656c
to
f12b0b0
Compare
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.
A couple small things left. Should be good to go once addressed, I think
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 - nice!
3db620a
to
f28713a
Compare
https://github.com/neondatabase/cloud/issues/22997
Initially, this PR set out to create a
cert-manager.io/Certificate
object for each VM. However, a design decision for cert-manager has the associated secrets produced as orphans. This caused secrets to accumulate without cleanup.Instead, I have augmented the flow to emulate
Certificate
.This only takes place if the VM spec lists a TlsCertificateIssuer value