-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add active health checks to TransportServer #1384
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.
Thanks for addressing feedback. I got a few more comments/suggestion related to the new code.
35c1feb
to
d0c60e8
Compare
internal/configs/transportserver.go
Outdated
var upstreams []version2.StreamUpstream | ||
var hc *version2.StreamHealthCheck | ||
|
||
for _, u := range transportServerEx.TransportServer.Spec.Upstreams { |
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.
Can we remove the health check generation from this method?
At the moment, it appears to create a healthcheck for each upstream, but there is only one pointer. I think the value is overridden so it only returns the healthcheck for the last upstream, is this correct?
How about a new function, which takes the upstreams (transportServerEx.TransportServer.Spec.Upstreams ?) and returns the health checks for each one?
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.
At the moment, it appears to create a healthcheck for each upstream, but there is only one pointer. I think the value is overridden so it only returns the healthcheck for the last upstream, is this correct?
Yeah that's right, at the moment we don't support multiple health checks, so I'll refactor so that the only health check that's generated is the one that referenced the right upstream
@@ -4,6 +4,7 @@ import ( | |||
"reflect" | |||
"testing" | |||
|
|||
"github.com/google/go-cmp/cmp" |
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 mentioned previously about the pointer override, assuming this is not intended behaviour, can we add a test to confirm that two upstreams generates two health checks ? I think there's multiple health checks in the tests below, but some of them are invalid ?
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!
eb1b350
to
dc5dedc
Compare
Proposed changes
This PR adds active health checks support to Transport Servers for NGINX Plus. It adds a health check field to yaml and fields for better configuring the health checks.
Checklist
Before creating a PR, run through this checklist and mark each as complete.