- 
                Notifications
    
You must be signed in to change notification settings  - Fork 460
 
          Allow configuring API server LB rule name and health probe in AzureCluster
          #5828
        
          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
base: main
Are you sure you want to change the base?
  
    Allow configuring API server LB rule name and health probe in AzureCluster
  
  #5828
              Conversation
| 
           [APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 @cPu1. 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.  | 
    
          Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #5828      +/-   ##
==========================================
+ Coverage   46.93%   47.02%   +0.09%     
==========================================
  Files         279      279              
  Lines       29687    29721      +34     
==========================================
+ Hits        13934    13977      +43     
+ Misses      14940    14931       -9     
  Partials      813      813              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
4874668    to
    bc3771f      
    Compare
  
    …ureCluster Signed-off-by: cpu1 <[email protected]>
bc3771f    to
    b8e4561      
    Compare
  
    | 
           @jsturtevant, @marosset, can you help review this PR?  | 
    
| 
           /ok-to-test  | 
    
| 
           /test pull-cluster-api-provider-azure-e2e-workload-upgrade  | 
    
| 
           @cPu1: The following test failed, say  
 Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here.  | 
    
| // LoadBalancingRule defines the load balancer rule configuration. | ||
| // +optional | ||
| LoadBalancingRule LoadBalancingRule `json:"loadBalancingRule,omitempty"` | 
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 don't love that this introduces an assumption that a load balancer will only ever have one rule. If we ever add more, then this field becomes ambiguous. I don't know why we would ever want to do that, but I'm equally unsure that one is all we'll ever want.
This also adds the field for the other kinds of load balancers CAPZ creates (worker/controlplane outbound) but it does nothing in those cases. I would slightly prefer the approach we took with AdditionalAPIServerLBPorts where it lives up a level and specifically applies only to the API server LB:
cluster-api-provider-azure/api/v1beta1/types.go
Lines 114 to 117 in cc24323
| // AdditionalAPIServerLBPorts specifies extra inbound ports for the APIServer load balancer. | |
| // Each port specified (e.g., 9345) creates an inbound rule where the frontend port and the backend port are the same. | |
| // +optional | |
| AdditionalAPIServerLBPorts []LoadBalancerPort `json:"additionalAPIServerLBPorts,omitempty"` | 
What type of PR is this?
/kind feature
What this PR does / why we need it:
This changelist allows configuring the names for the API server load balancer rule and health probe to support cluster adoption scenarios where existing networking resources already exist with different names.
Currently, CAPZ hardcodes the load balancer rule name (
LBRuleHTTPS) and health probe name (HTTPSProbe) for the API server load balancer, making it difficult to adopt existing Kubeadm-based clusters using different naming conventions, as users cannot reuse existing load balancer resources without manual intervention. Since the rule name and probe name cannot be changed without destroying and recreating the resource, adopting a Kubeadm cluster into Cluster API can result in some downtime.This PR adds two new optional fields
LoadBalancingRule.NameandHealthProbe.NametoLoadBalancerSpec.To ensure backward compatibility, the defaulting webhook uses default values that match the previous hardcoded names (
LBRuleHTTPSandHTTPSProbe). Since changing the load balancer rule name and health probe name requires resource recreation, a destructive operation, the validating webhook disallows mutations to these fields.There are no breaking changes as this is a purely additive change that maintains full backward compatibility.
Please note that there's a known bug caused by reusing the same health probe for
AdditionalAPIServerLBPortsbut this PR keeps the current behavior unchanged.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #5726
TODOs:
Release note: