-
Notifications
You must be signed in to change notification settings - Fork 272
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 numOfProbe and probeInterval in health probe configuration #950
Add numOfProbe and probeInterval in health probe configuration #950
Conversation
Hi @MartinForReal. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
More units are being added. |
/ok-to-test |
pkg/provider/azure_loadbalancer.go
Outdated
numberOfProbes, err := getInt32FromAnnotations(s.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeNumOfProbe, func(val *int32) error { | ||
//total probe should be less than 120, minimum probe interval is 2 and minimum number of unhealthy responses is 2 | ||
//number of probe values should range between 2 to 60 | ||
if *val > 60 || *val < 2 { |
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.
Could you get the interval first and validate the total probe interval by number*interval
?
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.
Moved this business rule out of validator function and check it at the end of the function, which decouples the validator functions.
pkg/provider/azure_loadbalancer.go
Outdated
|
||
probeInterval, err := getInt32FromAnnotations(s.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeInterval, func(val *int32) error { | ||
//total probe should be less than 120 | ||
if (*val)*(*numberOfProbes) >= 120 { |
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.
also need to check the minimum value
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.
validation rule is added .
return probeInterval, numberOfProbes, nil | ||
} | ||
|
||
type Int32BusinessValidator func(*int32) error |
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.
Could you add some comments for newly added types and functions?
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.
added
} | ||
} | ||
|
||
func Test_getProbeIntervalInSecondsAndNumOfProbe(t *testing.T) { |
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 adding those tests. Could you also add another test for updating annotation values? e.g. when the value of the probe interval annotation changes, the probe interval on LB should be updated from the old value to the new 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.
This is a common case for ccm but this case is out of current scope because here we only provide expected configuration of loadbalancer probe
@MartinForReal please enrich the doc here in a separate PR. https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/site/content/en/topics/loadbalancer.md |
Signed-off-by: Shangxiang Fan <shafan@microsoft.com>
/retest |
/lgtm |
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 the comments. LGTM
/lgtm
/approve
After the PR merged, please file new PRs for 1) update docs and 2) cherry pick the changes to release branches
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, MartinForReal 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 |
Signed-off-by: Shangxiang Fan shafan@microsoft.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #948
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: