-
Notifications
You must be signed in to change notification settings - Fork 280
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
Container Load Balancer - LB Rules #8218
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: georgeedward2000 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @georgeedward2000. 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-sigs/prow repository. |
pkg/provider/azure_loadbalancer.go
Outdated
@@ -2800,6 +2800,36 @@ func (az *Cloud) getExpectedLBRules( | |||
isIPv6 bool, | |||
) ([]*armnetwork.Probe, []*armnetwork.LoadBalancingRule, error) { | |||
var expectedRules []*armnetwork.LoadBalancingRule | |||
// If we are using Pod IP in the LB backend, we skip health probes, disable floating IP and use port.TargetPort. | |||
if az.IsLBBackendPoolTypePodIP() { | |||
// Check for multi-IP families in the service spec (not allowed for CLB). |
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.
rewrite to mention pod ip backend config instead of clb
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.
update in the latest commit
@@ -2800,6 +2800,36 @@ func (az *Cloud) getExpectedLBRules( | |||
isIPv6 bool, |
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.
add PR desc
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.
updated the PR description
pkg/provider/azure_loadbalancer.go
Outdated
// Turn off floating IP and skip health probe attachments. | ||
props.EnableFloatingIP = ptr.To(false) | ||
props.Probe = nil | ||
props.BackendPort = ptr.To(int32(port.TargetPort.IntValue())) |
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 think we won't be able to support named Port (https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports). Better to throw a validation error.
@georgeedward2000 Thanks for the contribution. Could you sign CLA? |
And could you use the template (the template would show when you open the PR) and fill the template contents (including release notes information together with what this PR does)? /kind feature |
@@ -382,8 +382,7 @@ const ( | |||
// LoadBalancerBackendPoolConfigurationTypeNodeIP is the lb backend pool config type node ip | |||
LoadBalancerBackendPoolConfigurationTypeNodeIP = "nodeIP" | |||
// LoadBalancerBackendPoolConfigurationTypePODIP is the lb backend pool config type pod ip | |||
// TODO (nilo19): support pod IP in the future | |||
LoadBalancerBackendPoolConfigurationTypePODIP = "podIP" | |||
LoadBalancerBackendPoolConfigurationTypePodIP = "podIP" | |||
) |
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.
Good catch for the variable name here👍
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.
Have we decided to use this instead of loadBalancerClass?
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.
There are also a set of lint failures, could you rebase the PR to master branch?
pkg/provider/azure_loadbalancer.go
Outdated
// Build rules for each service port but with floatingIP = false, no health probes. | ||
for _, port := range service.Spec.Ports { | ||
if port.TargetPort.Type == intstr.String { | ||
return nil, nil, fmt.Errorf("named targetPort is not supported when LB backend pool type is PodIP: %s", port.TargetPort.StrVal) |
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.
are we able to make port name work?
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.
Since, CLB directly rewrites the Destination Port in the packet after selecting the Destination POD, I think we can't support named Port specified in https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
29bb3c8
to
8f489e7
Compare
pkg/provider/azure_loadbalancer.go
Outdated
if az.IsLBBackendPoolTypePodIP() { | ||
// Check for multi-IP families in the service spec (not allowed for BackendPool of type PodIP). | ||
if len(service.Spec.IPFamilies) > 1 { | ||
return nil, nil, fmt.Errorf("dual-stack services are not supported when LB backend pool type is PodIP") |
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.
In the design doc it says "For dual stack, 2 services need to be created". Can you double check which one is the right behavior?
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.
yes, that is right. Should I update the error string to say precisely that?
@@ -2815,6 +2816,39 @@ func (az *Cloud) getExpectedLBRules( | |||
isIPv6 bool, | |||
) ([]*armnetwork.Probe, []*armnetwork.LoadBalancingRule, error) { | |||
var expectedRules []*armnetwork.LoadBalancingRule | |||
// If we are using Pod IP in the LB backend, we skip health probes, disable floating IP and use port.TargetPort. | |||
if az.IsLBBackendPoolTypePodIP() { |
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 please extract this as a new func to make the main loop concise?
@@ -180,6 +180,10 @@ func (az *Config) IsLBBackendPoolTypeNodeIP() bool { | |||
return strings.EqualFold(az.LoadBalancerBackendPoolConfigurationType, consts.LoadBalancerBackendPoolConfigurationTypeNodeIP) | |||
} | |||
|
|||
func (az *Config) IsLBBackendPoolTypePodIP() bool { |
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.
Need a check to block podIP + non-standardV2?
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.
If conflicted with multi-slb, need to block as well.
I think for features under development, release note should be none, as they have no impact to the user for now. @feiskyer correct me if wrong. |
/label tide/merge-method-squash |
Adding label 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-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR introduces updates to LB rules and probes for the Container Load Balancer. The key changes are as follows:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: