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
Support customization of numOfProbe and probeInterval when externaltrafficpolicy is local #4207
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
e1b4fa5
to
c48a6e5
Compare
// Not need to verify probePort is in correct range again. | ||
for _, item := range serviceManifest.Spec.Ports { | ||
//nolint:gosec | ||
if item.Port == int32(port) { |
Check failure
Code scanning / CodeQL
Incorrect conversion between integer types High
strconv.Atoi
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.
upper bound check has been added. false alarm.
3a36fef
to
97f36e3
Compare
/test pull-cloud-provider-azure-e2e-ccm-capz |
/test pull-cloud-provider-azure-e2e-ccm-capz |
97f36e3
to
c00a160
Compare
c00a160
to
3728d5a
Compare
} | ||
|
||
// getHealthProbeConfigProbeIntervalAndNumOfProbe | ||
func (az *Cloud) getHealthProbeConfigProbeIntervalAndNumOfProbe(serviceManifest *v1.Service, port int32) (*int32, *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.
newly added.
…afficpolicy is local
3728d5a
to
c405fc7
Compare
// getHealthProbeConfigProbeInterval get probe interval in seconds | ||
// minimum probe interval in seconds is 5. ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe | ||
// if probeInterval is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe | ||
func (*Cloud) getHealthProbeConfigProbeInterval(serviceManifest *v1.Service, port int32) (*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.
newly added.
// getHealthProbeConfigNumOfProbe get number of probes | ||
// minimum number of unhealthy responses is 2. ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe | ||
// if numberOfProbes is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe | ||
func (*Cloud) getHealthProbeConfigNumOfProbe(serviceManifest *v1.Service, port int32) (*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.
newly added.
properties.RequestPath = path | ||
} | ||
|
||
properties.IntervalInSeconds, properties.ProbeThreshold, err = az.getHealthProbeConfigProbeIntervalAndNumOfProbe(serviceManifest, port.Port) |
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.
extracted three functions from here.
@@ -2396,15 +2193,18 @@ func (az *Cloud) getExpectedLBRules( | |||
if servicehelpers.NeedsHealthCheck(service) && !(consts.IsPLSEnabled(service.Annotations) && consts.IsPLSProxyProtocolEnabled(service.Annotations)) { | |||
podPresencePath, podPresencePort := servicehelpers.GetServiceHealthCheckPathPort(service) | |||
lbRuleName := az.getLoadBalancerRuleName(service, v1.ProtocolTCP, podPresencePort, isIPv6) | |||
|
|||
probeInterval, numberOfProbes, err := az.getHealthProbeConfigProbeIntervalAndNumOfProbe(service, podPresencePort) |
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.
newly added.
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
/cherrypick release-1.27 |
@MartinForReal: #4207 failed to apply on top of branch "release-1.27":
In response to this:
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. |
/cherrypick release-1.27 |
@MartinForReal: #4207 failed to apply on top of branch "release-1.27":
In response to this:
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. |
@MartinForReal - was this PR successfully cherry-picked for release-1.27? I don't see the merge commit for this PR in the release changelog: v1.27.5...v1.27.6 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Support customization of numOfProbe and probeInterval when externaltrafficpolicy is local
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
move health probe related code to azure_loadbalancer_healthprobe*
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: