-
Notifications
You must be signed in to change notification settings - Fork 326
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
Webhook refactor #454
Webhook refactor #454
Conversation
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.
Had a few comments during an initial lookover, I like how it's coming together!
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.
The approach looks good to me!
I had one minor question, but overall I think this is the right direction. Thanks for doing the refactor!
The failing tests seem related to the refactor with consul-init. It was failing on the branch and i didnt spend too much time digging into it. |
ad0d781
to
fd1b1c3
Compare
11a22f7
to
5afa987
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.
Looks great!!! I ❤️ how you cleaned up the handler and that we don't need cert watcher anymore and to run our own webhook server!
I left some minor comments. The only blocking question on my side is whether we should keep the -listen
flag backward compatible.
6f5f8e7
to
2d1c75b
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.
Looks great!
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.
This looks great.
I left a couple "nit" suggestions, and two questions but otherwise 🆗 !
(the compilation error of course being a blocker but I'm sure it'll be sorted)
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.
I love the cleanup and simplification of the code you've done!! Amazing work!! Had a few suggestions around comments/logging and a question/thought about the tests in CI with the manager running.
752eca4
to
715854a
Compare
9b36f01
to
c2c32fb
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.
Looks great!!
9504d0d
to
2d73c52
Compare
* supports using serviceName annotation (different k8s service name) * supports using servicePort annotation * supports creating endpoints (with serviceName annotation) * supports updating endpoints (adding and removing addresses) * supports deleting endpoints (with different k8s service name) todo: * tags, meta, and upstreams from annotations + tests * cleaning up and refactoring code to run the endpoints controller with manager * deleting old service registration * testing with new connect-init command * testing end to end Co-authored-by: Iryna Shustava <[email protected]> Co-authored-by: Kyle Schochenmaier <[email protected]>
- Replace pointer references with values refernces in methods used by connect-inject for Pods.
- This watcher watches for Consul Agent pods to be in a running phase and the condition ready to be true and then reconcile all endpoints that have a ready/not-ready address that share a node name with that of the consul agent pod.
2d73c52
to
72f21d6
Compare
* Refactor handler webhook to be of type admission.Webhook - Replace pointer references with values refernces in methods used by connect-inject for Pods. * Add watcher for agent pods to endpoints controller - This watcher watches for Consul Agent pods to be in a running phase and the condition ready to be true and then reconcile all endpoints that have a ready/not-ready address that share a node name with that of the consul agent pod.
* Refactor handler webhook to be of type admission.Webhook - Replace pointer references with values refernces in methods used by connect-inject for Pods. * Add watcher for agent pods to endpoints controller - This watcher watches for Consul Agent pods to be in a running phase and the condition ready to be true and then reconcile all endpoints that have a ready/not-ready address that share a node name with that of the consul agent pod.
* Refactor handler webhook to be of type admission.Webhook - Replace pointer references with values refernces in methods used by connect-inject for Pods. * Add watcher for agent pods to endpoints controller - This watcher watches for Consul Agent pods to be in a running phase and the condition ready to be true and then reconcile all endpoints that have a ready/not-ready address that share a node name with that of the consul agent pod.
…nit-role Restrict permissions for the server-acl-init job
Refactor the connect-inject webhook to use the
admission.Webhook
library for it's behavior. The behavior of the webhook should remain unchanged. The difference now is that the webhook does not manage its own certificates. Rather it relies on the webhook cert manager to provision certificates for it as a mounted secret.This allows us to remove our dependency from DiskCerts and also remove the code involved with cert generation on the connect webhook. This is hopefully allow for the a degree of HA with the deployment as the webhook certificates will be consistent across the pods and webhook configuration.
I have also updated some of the methods within the connect package that previously has method signatures with (*Pod) -> (Pod) as they were not performing modifications on the Pod object.
How to test this PR: Code Review
There will be a companion Helm PR where these changes shall be acceptance tested and will try and ensure behavior is still the same.