-
Notifications
You must be signed in to change notification settings - Fork 461
Use internal LB's IP for intra-node communication #5209
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -265,6 +265,35 @@ func (s *ClusterScope) LBSpecs() []azure.ResourceSpecGetter { | |
| }, | ||
| } | ||
|
|
||
| if s.APIServerLB().Type != infrav1.Internal { | ||
| specs = append(specs, &loadbalancers.LBSpec{ | ||
| Name: s.APIServerLB().Name + "-internal", | ||
| ResourceGroup: s.ResourceGroup(), | ||
| SubscriptionID: s.SubscriptionID(), | ||
| ClusterName: s.ClusterName(), | ||
| Location: s.Location(), | ||
| ExtendedLocation: s.ExtendedLocation(), | ||
| VNetName: s.Vnet().Name, | ||
| VNetResourceGroup: s.Vnet().ResourceGroup, | ||
| SubnetName: s.ControlPlaneSubnet().Name, | ||
| FrontendIPConfigs: []infrav1.FrontendIP{ | ||
| { | ||
| Name: s.APIServerLB().Name + "-internal-frontEnd", // TODO: improve this name. | ||
| FrontendIPClass: infrav1.FrontendIPClass{ | ||
| PrivateIPAddress: infrav1.DefaultInternalLBIPAddress, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be made configurable via the spec in the future as @willie-yao mentioned below. Might be worth opening an issue for improvement |
||
| }, | ||
| }, | ||
| }, | ||
| APIServerPort: s.APIServerPort(), | ||
| Type: infrav1.Internal, | ||
| SKU: s.APIServerLB().SKU, | ||
| Role: infrav1.APIServerRoleInternal, | ||
| BackendPoolName: s.APIServerLB().BackendPool.Name + "-internal", | ||
| IdleTimeoutInMinutes: s.APIServerLB().IdleTimeoutInMinutes, | ||
| AdditionalTags: s.AdditionalTags(), | ||
| }) | ||
| } | ||
|
|
||
| // Node outbound LB | ||
| if s.NodeOutboundLB() != nil { | ||
| specs = append(specs, &loadbalancers.LBSpec{ | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,12 @@ spec: | |
| name: ${CLUSTER_IDENTITY_NAME} | ||
| location: ${AZURE_LOCATION} | ||
| networkSpec: | ||
| apiServerLB: | ||
| frontendIPs: | ||
| - name: ${CLUSTER_NAME}-api-lb | ||
| publicIP: | ||
| dnsName: ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com | ||
| name: ${CLUSTER_NAME}-api-lb | ||
| subnets: | ||
| - name: control-plane-subnet | ||
| role: control-plane | ||
|
|
@@ -189,7 +195,9 @@ spec: | |
| kubeletExtraArgs: | ||
| cloud-provider: external | ||
| name: '{{ ds.meta_data["local_hostname"] }}' | ||
| preKubeadmCommands: [] | ||
| preKubeadmCommands: | ||
| - echo '10.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' | ||
nawazkh marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be cleaner to do this in This approach would allow us to entirely skip the need to pass in the dnsName manually in another part of the template, and we'd just rely upon the existing foo and kubeadm to tell us this info. I'm pretty sure we'd need to do this as a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I like the idea. One less variable to manage. However, isn't it better to setup custom DNS resolution for the API Server in What do you say?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will But that may not be practical for Windows nodes that come online later (it may be too late and as you mention, kubeadm join may fail and block cc @jsturtevant
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's postpone worrying about this for now so we can land this change sooner.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think it will be present, kubeadm creates it. |
||
| >> /etc/hosts | ||
| --- | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
| kind: AzureClusterIdentity | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.