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

Allow deprecated beta topology labels to be applied for those not ready to migrate #3685

Merged

Conversation

JoelSpeed
Copy link
Contributor

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

#2653 removed the deprecated labels completely, however, other cloud providers have not yet removed these and there are a lot of people out there who are probably not ready to migrate. For example, the Azure Red Hat OpenShift offering has not announced removal of the labels and still supports the labels, even though Microsoft and AKS have removed them.

This PR introduces a softer change, allowing users to maintain the old behaviour should they wish to.

Commit wise, it does:

  • Reverts 2653 to put things back to how they were
  • Refactors the cloud node modifier code to clean that up ahead of later changes
  • Switch priority from beta labels to GA labels, so that GA labels become the source of truth
  • Adds --deprecated-apply-beta-topology-labels as a flag, off by default, that allows users to opt-in to the old behaviour

I think this should maintain the direction of the Azure provider, while allowing those who aren't yet ready to drop the labels, to continue using them until they have migrated.

My suggestion would be to keep these labels and this flag in-place until the wider cloud-provider community has sunset the labels completely and worked out the migration path for everyone.

Which issue(s) this PR fixes:

Fixes #2453

Special notes for your reviewer:

Does this PR introduce a user-facing change?

The deprecated beta topology labels are no longer applied by default, to maintain the legacy behaviour use `--deprecated-apply-beta-topology-labels`

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 3, 2023
@netlify
Copy link

netlify bot commented Apr 3, 2023

Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.

Name Link
🔨 Latest commit dba7928
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cloud-provide-azure/deploys/64672f6c2d8a0700082a8f7c

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 3, 2023
@coveralls
Copy link

coveralls commented Apr 3, 2023

Coverage Status

Coverage: 79.692% (+0.1%) from 79.589% when pulling 5416552 on JoelSpeed:optional-deprecated-labels into 6a378e6 on kubernetes-sigs:master.

@bridgetkromhout
Copy link

/retest

// DeprecatedApplyBetaTopologyLabels indicates whether the node should apply beta topology labels.
// If true, the node will apply beta topology labels.
// DEPRECATED: This flag will be removed in a future release.
DeprecatedApplyBetaTopologyLabels bool
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should change the behavior for the versions that have already been released, it may break some existing v1.26+ clusters.

Could we change this to something like "EnableDepecatedBetaTopologyLabels" and default it to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should change the behavior for the versions that have already been released, it may break some existing v1.26+ clusters.

Agreed. The current behaviour is that the behaviour stays the same as master now, unless you opt in, ie the flag defaults to false and we only apply the labels when the flag is explicitly specified

Could we change this to something like "EnableDepecatedBetaTopologyLabels" and default it to false?

I can go through and rename everything, sure

}

return nodeModifiers, nil
}

// addCloudNodeLabel creates a nodeModifier that adds a label to a node.
func addCloudNodeLabel(key, value string) func(*v1.Node) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the refactoring, it looks much better!

@JoelSpeed
Copy link
Contributor Author

Renamed as suggested, and as per my comment, this is off by default to persist 1.26 behaviour anyway, so should be good to go if we are happy with the new naming

@JoelSpeed
Copy link
Contributor Author

/retest

@feiskyer Are you happy with the new naming? Any further feedback or can we get this merged?

@nilo19
Copy link
Contributor

nilo19 commented Apr 22, 2023

Can the user who wants to use these labels continue using the old versions of cloud provider azure, and change their app behavior before upgrading to the newer version?

@nilo19
Copy link
Contributor

nilo19 commented Apr 22, 2023

The kubernetes has decided to deprecate these labels so I think it would be better if we keep aligned with the kubernetes upstream. By the way, if we want to merge this, don't forget to squash the commits.

@JoelSpeed
Copy link
Contributor Author

Can the user who wants to use these labels continue using the old versions of cloud provider azure, and change their app behavior before upgrading to the newer version?

IMO this is undesirable since it blocks users from upgrading. Imagine I am running a platform for my large company, I want to keep Kubernetes up to date so need the latest CCM. I have 1000s of developers running applications on there, it will likely take some time to get all of their applications migrated.
Yes, some will have started this process, I suspect many will not have done.

The kubernetes has decided to deprecate these labels so I think it would be better if we keep aligned with the kubernetes upstream. By the way, if we want to merge this, don't forget to squash the commits.

Other providers that use the core logic still sync beta to stable, they have deprecated the label but are far from removing the sync logic from their providers as far as I understand, Azure is way ahead here in this regard.

I had kept the commits as separate logical commits but can squash, (or maybe tide can?) if you prefer it that way, LMK

@JoelSpeed
Copy link
Contributor Author

@nilo19 Would you like me to squash this so we can merge? Or can we use the tide squash method?

@JoelSpeed
Copy link
Contributor Author

@nilo19 any further comments? Hoping to get this merged soon

@feiskyer
Copy link
Member

@JoelSpeed sorry for the delay. Could you squash the commits?

…dy to migrate

This reverts commit 67c2407.
It then introduces a new flag to allow users to opt-in to syncing older, beta
topology labels based on the presence of the GA topolgoy labels.
@JoelSpeed
Copy link
Contributor Author

@JoelSpeed sorry for the delay. Could you squash the commits?

Sure, just pushed a squashed commit and rebased on the latest master

@feiskyer
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, JoelSpeed

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 May 20, 2023
@feiskyer
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit bf80827 into kubernetes-sigs:master May 22, 2023
20 checks passed
@nilo19
Copy link
Contributor

nilo19 commented Jun 6, 2023

/cherrypick release-1.26

@nilo19
Copy link
Contributor

nilo19 commented Jun 6, 2023

/cherrypick release-1.27

@k8s-infra-cherrypick-robot

@nilo19: new pull request created: #4040

In response to this:

/cherrypick release-1.26

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.

@k8s-infra-cherrypick-robot

@nilo19: new pull request created: #4041

In response to this:

/cherrypick release-1.27

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.

ialidzhikov added a commit to ialidzhikov/gardener-extension-provider-azure that referenced this pull request Aug 4, 2023
…e-manager, not cloud-controller-manager

gardener#716 added the flag to cloud-controller-manager. This fails with:
```
Error: unknown flag: --deprecated-apply-beta-topology-labels
```

The flag is supported for cloud-node-manager. See kubernetes-sigs/cloud-provider-azure#3685.
ialidzhikov added a commit to ialidzhikov/gardener-extension-provider-azure that referenced this pull request Aug 4, 2023
…e-manager, not cloud-controller-manager

gardener#716 added the flag to cloud-controller-manager. This fails with:
```
Error: unknown flag: --deprecated-apply-beta-topology-labels
```

The flag is supported for cloud-node-manager. See kubernetes-sigs/cloud-provider-azure#3685.
kon-angelo pushed a commit to gardener/gardener-extension-provider-azure that referenced this pull request Aug 5, 2023
…e-manager, not cloud-controller-manager (#717)

#716 added the flag to cloud-controller-manager. This fails with:
```
Error: unknown flag: --deprecated-apply-beta-topology-labels
```

The flag is supported for cloud-node-manager. See kubernetes-sigs/cloud-provider-azure#3685.
kon-angelo pushed a commit to kon-angelo/gardener-extension-provider-azure that referenced this pull request Aug 8, 2023
…e-manager, not cloud-controller-manager (gardener#717)

gardener#716 added the flag to cloud-controller-manager. This fails with:
```
Error: unknown flag: --deprecated-apply-beta-topology-labels
```

The flag is supported for cloud-node-manager. See kubernetes-sigs/cloud-provider-azure#3685.
ialidzhikov added a commit to gardener/gardener-extension-provider-azure that referenced this pull request Aug 8, 2023
* Configure CCM to keep setting deprecated labes on the nodes (#716)

* Pass the `--enable-deprecated-beta-topology-labels` flag to cloud-node-manager, not cloud-controller-manager (#717)

#716 added the flag to cloud-controller-manager. This fails with:
```
Error: unknown flag: --deprecated-apply-beta-topology-labels
```

The flag is supported for cloud-node-manager. See kubernetes-sigs/cloud-provider-azure#3685.

---------

Co-authored-by: Vladimir Nachev <vladimir.nachev@sap.com>
Co-authored-by: Ismail Alidzhikov <i.alidjikov@gmail.com>
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/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using deprecated labels in cloud-node-manager since v1.26.0
7 participants