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

🐛 Restore subnet management functionality #4474

Merged

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Aug 31, 2023

/kind bug
/kind api-change
/kind regression

What this PR does / why we need it:

This PR reverts some commits originally introduced in #3748 to support ClusterClass with SSA and proposes a different approach that's backward compatible with that functionality.

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

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

action required
When the VPC is managed, the `SubnetSpec.ID` field can be used now to offload subnet management to the AWSCluster controller. The `id` should be set to a string that DOES NOT start with `subnet-`; the value is used to set the `Name` tag in the subnet resource and the actual AWS resource ID is stored in `SubnetSpec.ResourceID`.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 31, 2023
@vincepri
Copy link
Member Author

/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed needs-priority labels Aug 31, 2023
@vincepri
Copy link
Member Author

/assign @richardcase

/cc @fabriziopandini @sbueringer

@vincepri
Copy link
Member Author

/cc @AverageMarcus @AndiDog

Might also be good to incorporate giantswarm@407bd98

@k8s-ci-robot
Copy link
Contributor

@vincepri: GitHub didn't allow me to request PR reviews from the following users: AndiDog.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @AverageMarcus @AndiDog

Might also be good to incorporate giantswarm@407bd98

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.

@AndiDog
Copy link
Contributor

AndiDog commented Aug 31, 2023

/cc @AverageMarcus @AndiDog

Might also be good to incorporate giantswarm@407bd98

I'd be happy if you cherry-pick that commit. That's exactly the workaround we have in our fork for the moment. It applies almost cleanly to v2.2.1, so I'm sure the patch is still fine.

What do maintainers say about reverting to the original behavior for now? (CC @richardcase who was also involved in network discussions apart from the people already assigned on this PR)

@vincepri vincepri force-pushed the revert-subnet-id-required branch from ebb6ac5 to 2dfc9bd Compare August 31, 2023 22:57
@vincepri
Copy link
Member Author

/test ?

@k8s-ci-robot
Copy link
Contributor

@vincepri: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-clusterclass
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks
  • /test pull-cluster-api-provider-aws-e2e-eks-gc
  • /test pull-cluster-api-provider-aws-e2e-eks-testing

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

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.

@vincepri
Copy link
Member Author

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-blocking
/test pull-cluster-api-provider-aws-e2e-clusterclass
/test pull-cluster-api-provider-aws-e2e-conformance

@vincepri vincepri force-pushed the revert-subnet-id-required branch from 2dfc9bd to b78118f Compare August 31, 2023 23:03
@vincepri
Copy link
Member Author

From a project and SIG perspective, we should strive to retain key features and behavior that made this project successful. With Terraform licensing change, I suspect more and more users would prefer Cluster API to manage infrastructure required to have a functional cluster. Subnets are definitely in that mix.

The reversal of these commits it's not a breaking change, but rather a regression fix; going from required to optional is fine from an API perspective.

Regarding ClusterClass and SSA, as mentioned in the PR description we should find alternative solutions rather than breaking existing functionality.

@vincepri vincepri force-pushed the revert-subnet-id-required branch from b78118f to 214db67 Compare August 31, 2023 23:09
@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 Sep 1, 2023
@vincepri vincepri force-pushed the revert-subnet-id-required branch from cfe1665 to 3b77e28 Compare September 1, 2023 04:51
@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 4, 2023
Copy link
Contributor

@AndiDog AndiDog left a comment

Choose a reason for hiding this comment

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

/hold

(due to review comments)

api/v1beta1/awscluster_conversion.go Show resolved Hide resolved
api/v1beta1/awscluster_conversion.go Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Outdated Show resolved Hide resolved
api/v1beta2/network_types.go Outdated Show resolved Hide resolved
api/v1beta2/network_types.go Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Outdated Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Outdated Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Outdated Show resolved Hide resolved
pkg/cloud/services/network/subnets.go Show resolved Hide resolved
@richardcase
Copy link
Member

As discussed just now on slack, to allow more time for testing and review:

/milestone v2.3.0

@k8s-ci-robot k8s-ci-robot modified the milestones: v2.2.3, v2.3.0 Oct 4, 2023
@vincepri vincepri force-pushed the revert-subnet-id-required branch 3 times, most recently from 9c9eb0c to 112640d Compare October 4, 2023 15:50
@vincepri
Copy link
Member Author

vincepri commented Oct 4, 2023

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

@vincepri
Copy link
Member Author

vincepri commented Oct 4, 2023

/test pull-cluster-api-provider-aws-e2e-eks
/test pull-cluster-api-provider-aws-e2e-eks-gc
/test pull-cluster-api-provider-aws-e2e-clusterclass

@vincepri
Copy link
Member Author

vincepri commented Oct 4, 2023

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Oct 4, 2023

@vincepri: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-e2e-eks-gc 112640dc71609532d4d550330d8e009ffbfdde97 link false /test pull-cluster-api-provider-aws-e2e-eks-gc
pull-cluster-api-provider-aws-e2e-eks 112640dc71609532d4d550330d8e009ffbfdde97 link false /test pull-cluster-api-provider-aws-e2e-eks

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.

@vincepri vincepri force-pushed the revert-subnet-id-required branch from 112640d to ca671fb Compare October 4, 2023 20:26
@vincepri
Copy link
Member Author

vincepri commented Oct 4, 2023

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

@AndiDog
Copy link
Contributor

AndiDog commented Oct 6, 2023

Looks good so far. Which cases did you test manually so far? Should we help testing this change before merging?

I think we should fix the single-case switch statement – see the remaining comment. Then all comments seem to be addressed.

@vincepri vincepri force-pushed the revert-subnet-id-required branch from ca671fb to 66eb159 Compare October 6, 2023 16:50
@vincepri
Copy link
Member Author

vincepri commented Oct 6, 2023

@AndiDog Only tested without ClusterClass, creating subnets managed by CAPA in different AZs. I'll fix the switch statement now; given the e2e are passing we should be good to merge and follow-up with the other tests/bits later?

@vincepri vincepri force-pushed the revert-subnet-id-required branch from 66eb159 to 703ec18 Compare October 6, 2023 20:49
Copy link
Contributor

@AndiDog AndiDog left a comment

Choose a reason for hiding this comment

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

/lgtm
/unhold

@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 Oct 8, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit 54bfea1 into kubernetes-sigs:main Oct 8, 2023
6 checks passed
@k8s-infra-cherrypick-robot

@richardcase: #4474 failed to apply on top of branch "release-2.2":

Applying: Revert "Make subnet spec id field required for SSA to work with CC"
Applying: Revert "Remove multi-az e2e test (it is no longer supported)"
Applying: Fix SSA support by adding Subnet.ResourceID field
Using index info to reconstruct a base tree...
M	api/v1beta1/awscluster_conversion.go
M	api/v1beta1/zz_generated.conversion.go
M	api/v1beta2/network_types.go
M	config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml
M	config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml
M	config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml
M	pkg/cloud/scope/shared_test.go
M	pkg/cloud/services/ec2/bastion.go
M	pkg/cloud/services/ec2/instances.go
M	pkg/cloud/services/elb/loadbalancer.go
M	pkg/cloud/services/network/natgateways.go
M	pkg/cloud/services/network/routetables.go
M	pkg/cloud/services/network/subnets.go
M	pkg/cloud/services/network/subnets_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/cloud/services/network/subnets_test.go
Auto-merging pkg/cloud/services/network/subnets.go
Auto-merging pkg/cloud/services/network/routetables.go
Auto-merging pkg/cloud/services/network/natgateways.go
Auto-merging pkg/cloud/services/elb/loadbalancer.go
Auto-merging pkg/cloud/services/ec2/instances.go
Auto-merging pkg/cloud/services/ec2/bastion.go
Auto-merging pkg/cloud/scope/shared_test.go
CONFLICT (content): Merge conflict in pkg/cloud/scope/shared_test.go
Auto-merging config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml
Auto-merging config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml
Auto-merging config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml
Auto-merging api/v1beta2/network_types.go
Auto-merging api/v1beta1/zz_generated.conversion.go
CONFLICT (content): Merge conflict in api/v1beta1/zz_generated.conversion.go
Auto-merging api/v1beta1/awscluster_conversion.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Fix SSA support by adding Subnet.ResourceID field
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-2.2

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.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. 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.

SubnetSpec changes in v1beta2 break existing use-cases
9 participants