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

Fix restoration of infra with migrated network layout #907

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

plkokanov
Copy link
Contributor

How to categorize this PR?

/area control-plane-migration
/kind bug
/platform azure

What this PR does / why we need it:
This PR modifies the layout mutator which adds the migration.azure.provider.extensions.gardener.cloud/zone annotation on the Infrastructure resource so that the annotation is also added during the restore phase of control plane migration in the following cases:

  1. If the .status.state field is defined and is in the azure.provider.extensions.gardener.cloud/v1alpha1 group version, then
    • If its .data field contains an entry for migration.azure.provider.extensions.gardener.cloud/zone, then this entry is added as an annotation to the Infrastructure resource
  2. If the .status.state field is defined and its type is InfrastructureState, then
    • If this .state field contains a .savedProviderStatus field and its .networks.subnets array contains a subnet for which the .migrated field is true and the .zone field is not nil

Additionally, during reconciliation, if the new flow reconciler is used and the migration.azure.provider.extensions.gardener.cloud/zone annotation is present on the Infrastructure resource, then it is persisted in the .status.state.data map.

Which issue(s) this PR fixes:
Fixes #827

Special notes for your reviewer:

Release note:

Fixed an issue that prevented the `Infrastructure` resource to be correctly restored during control plane migration, if the `Infrastructure` was previously migrated from a single subnet network layout to a multiple subnet network layout.

@plkokanov plkokanov requested review from a team as code owners June 27, 2024 08:13
@gardener-robot gardener-robot added needs/review Needs review area/control-plane-migration Control plane migration related kind/bug Bug platform/azure Microsoft Azure platform/infrastructure needs/rebase Needs git rebase labels Jun 27, 2024
@gardener-robot
Copy link

@plkokanov You need rebase this pull request with latest master branch. Please check.

@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 27, 2024
@gardener-robot gardener-robot added the size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) label Jun 27, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 27, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 27, 2024
@plkokanov
Copy link
Contributor Author

/hold
I want to do a few more tests of the changes.

@gardener-robot gardener-robot added the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Jun 27, 2024
@plkokanov
Copy link
Contributor Author

plkokanov commented Nov 27, 2024

I finally have time to come back to this and I have done the following tests all of which passed without issues:


  1. Create a cluster with 1 zone and 1 subnet layout using the terraform reconciler.
  2. Migrate the cluster from single zone layout to multiple zone layout, which adds the migration.azure.provider.extensions.gardener.cloud/zone annotation.
  3. Perform control plane migration to a destination seed which also uses the terraform reconciler.
  4. Check that the infrastructure resource is created on the destination seed with the correct (preserved) migration.azure.provider.extensions.gardener.cloud/zone annotation.

  1. Create a cluster with 1 zone and 1 subnet layout using the flow reconciler (seed has azure.provider.extensions.gardener.cloud/use-flow: "new" annotation)
  2. Migrate the cluster from single zone layout to multiple zone layout.
  3. Perform control plane migration to a destination seed which also uses the flow reconciler (seed has azure.provider.extensions.gardener.cloud/use-flow: "new" annotation)
  4. Check that the infrastructure resource is created on the destination seed with the correct (preserved) migration.azure.provider.extensions.gardener.cloud/zone annotation.

  1. Create a cluster with 1 zone and 1 subnet layout using the terraform reconciler.
  2. Migrate the cluster from single zone layout to multiple zone layout.
  3. Perform control plane migration to a destination seed which uses the flow reconciler for new shoots (seed has azure.provider.extensions.gardener.cloud/use-flow: "new" annotation)
  4. Check that the infrastructure resource is created on the destination seed with the correct (preserved) migration.azure.provider.extensions.gardener.cloud/zone annotation.

@kon-angelo, does it make sense to preform similar tests when migrating the control plane from a seed that uses the flow reconciler to a seed that uses the terraform reconciler (if that is even supported)?

In the tests above, would it make a difference if the annotation used to enable the flow reconciler is azure.provider.extensions.gardener.cloud/use-flow: "true" vs azure.provider.extensions.gardener.cloud/use-flow: "new"

@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 27, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 27, 2024
@plkokanov
Copy link
Contributor Author

/unhold

@gardener-robot gardener-robot removed the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Nov 27, 2024
@ialidzhikov ialidzhikov removed the needs/rebase Needs git rebase label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane-migration Control plane migration related kind/bug Bug needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review platform/azure Microsoft Azure platform/infrastructure size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
6 participants