Skip to content
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

separate route tables for node and control-plane #816

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

nader-ziada
Copy link
Contributor

What this PR does / why we need it:

  • add different route tables to for node and control-plane

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 #718

Special notes for your reviewer:

  • we need to confirm this is a valid requirements, there are some discussion on the issue if we need two route tables. I had done most of the code as part of the route table refactoring, so making a PR anyway

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Add separate route tables for node and control-plane

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 22, 2020
@k8s-ci-robot k8s-ci-robot added area/provider/azure Issues or PRs related to azure provider sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 22, 2020
@nader-ziada
Copy link
Contributor Author

/hold

for validation of the requirement

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 22, 2020
cloud/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 23, 2020
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2020
@nader-ziada
Copy link
Contributor Author

@CecileRobertMichon @jsturtevant do we still think we need this feature?

@CecileRobertMichon
Copy link
Contributor

@CecileRobertMichon @jsturtevant do we still think we need this feature?

I think so? it's more correct this way at least, even if we're not leveraging the route tables yet.

@jsturtevant
Copy link
Contributor

agreed, it is closer to the the way the public API is designed. The other alternative is to modify the API to only allow a single route table.

@aramase Do you know of scenarios where control plane would have a different route table than the worker nodes?

@nader-ziada
Copy link
Contributor Author

ok in that case ready for review
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 18, 2020
@aramase
Copy link
Member

aramase commented Aug 25, 2020

@aramase Do you know of scenarios where control plane would have a different route table than the worker nodes?

I don't see a scenario where we would need a different route table for control plane and worker nodes. I haven't had a chance to look at the PR completely, but when the control plane/worker node is bootstrapped is the RouteTableName in azure.json going to contain the control plane/worker node RT name populated appropriately?

@CecileRobertMichon
Copy link
Contributor

@aramase azure.json uses the node route table as "routeTableName" see https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/master/controllers/helpers.go#L228

BTW we should change that to get the actual NodeRouteTable().Name @nader-ziada, otherwise, it will break if the use uses a different name.

@nader-ziada
Copy link
Contributor Author

@aramase azure.json uses the node route table as "routeTableName" see https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/master/controllers/helpers.go#L228

BTW we should change that to get the actual NodeRouteTable().Name @nader-ziada, otherwise, it will break if the use uses a different name.

we only create one azure.json secret for machines, so control plane and worker machines will get the same, right?

@CecileRobertMichon
Copy link
Contributor

we only create one azure.json secret for machines, so control plane and worker machines will get the same, right?

we do create one per MD/Machine so technically they could have different ones (although right now the controller sets the same thing regardless of machine role). We are going to have to differ between the two as part of #921 anyways. What I'm not 100% sure about is why would you ever want you azure.json routeTable value to be the control plane route table?

@justaugustus justaugustus removed their request for review September 4, 2020 06:13
@nader-ziada
Copy link
Contributor Author

/test pull-cluster-api-provider-azure-e2e

@nader-ziada
Copy link
Contributor Author

rebased with ipv6

@nader-ziada
Copy link
Contributor Author

ready for review @CecileRobertMichon @devigned

@@ -89,7 +89,7 @@ func (c *AzureCluster) setSubnetDefaults() {
cpSubnet.SecurityGroup.Name = generateControlPlaneSecurityGroupName(c.ObjectMeta.Name)
}
if cpSubnet.RouteTable.Name == "" {
cpSubnet.RouteTable.Name = generateRouteTableName(c.ObjectMeta.Name)
cpSubnet.RouteTable.Name = generateControlPlaneRouteTableName(c.ObjectMeta.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider not creating a control plane route table by default and only creating it if the user specifies one since the default use case doesn't require one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so still use node route table unless the user specifies their own name of control plane route table?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the route table is attached to the subnet and the cloud provider cares about the NodeSubnet so it should only care about the NodeRouteTable. This behavior is just more correct because it doesn't ignore the Spec for route table on the control plane subnet and allows more advanced users to customize their cluster. But the default should stay the same, ie. Node subnet has a route table, control plane subnet doesn't, and the azure.json file has the node route table as routeTableName on all nodes.

@CecileRobertMichon
Copy link
Contributor

@k8s-ci-robot
Copy link
Contributor

@nader-ziada: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-azure-apidiff 5e08e50 link /test pull-cluster-api-provider-azure-apidiff

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/test-infra repository. I understand the commands that are listed here.

@nader-ziada
Copy link
Contributor Author

@CecileRobertMichon @devigned ready for another review. Thanks

@CecileRobertMichon
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2020
Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devigned

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2020
@k8s-ci-robot k8s-ci-robot merged commit 2e100d1 into kubernetes-sigs:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not currently handle creating seperate route tables for node and contorl plane
6 participants