-
Notifications
You must be signed in to change notification settings - Fork 304
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
reflect readiness probe in health check for NEG enabled ClusterIP service backend #582
Conversation
3b32456
to
053f57c
Compare
d696c01
to
7129d62
Compare
…abled ClusterIP service backend
7129d62
to
5bc2a43
Compare
// only one Service can match this nodePort, try and look up | ||
// the readiness probe of the pods behind it | ||
if int32(port.NodePort) == sp.NodePort { | ||
if port.NodePort != 0 && int32(port.NodePort) == sp.NodePort { |
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 you explain this check?
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.
For ClusterIP type service, NodePort will be 0.
For NEG, ingress can point to ClusterIP type service.
Then before this PR, when it gets here, it may pick up a random ClusterIP type service because its NodePort is 0 and use the corresponding pod's readiness probe which can be totally irrelevant.
This has not break anything because ingress requires NodePort type service before.
For NEG case, it will captured above.
Adding this check just to provide additional safety.
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.
Ack.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, rramkumar1 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Cherrypick #582 into release-1.4 branch
fixes: #541