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

KEP-2436 Leader Migration: to beta #103533

Merged
merged 3 commits into from Jul 9, 2021
Merged

KEP-2436 Leader Migration: to beta #103533

merged 3 commits into from Jul 9, 2021

Conversation

jiahuif
Copy link
Member

@jiahuif jiahuif commented Jul 7, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR graduates kubernetes/enhancements#2436 , Leader Migration for Controller Managers, from alpha to beta, by making following changes:

  • Change the feature flag from "alpha, disabled by default" to "beta, enabled by default"
  • Copy the v1alpha resource definitions to v1beta, and add corresponding registration & tests.

Special notes for your reviewer:

Leader Migration can graduate to beta because:

For vendor/ approver: This PR adds a new module k8s.io/controller-manager/config/v1beta1 as a result of API graduation. The module needs to be vendor'ed as a part of k8s.io/controller-manager.

For feature approver: This PR adds a feature gate defined in staging/src/k8s.io/controller-manager/pkg/features/kube_features.go to pkg/features/kube_features.go so that pkg/features/kube_features.go contains all feature gates of k8s.io/controller-manager.

Does this PR introduce a user-facing change?

Leader Migration for controller managers graduated to beta.

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

- [KEP]: https://github.com/kubernetes/enhancements/issues/2436

[1] SIG Cloud Provider Meeting Agenda, June 23

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 7, 2021
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. kind/feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 7, 2021
@jiahuif
Copy link
Member Author

jiahuif commented Jul 7, 2021

/assign @jpbetz

@jiahuif jiahuif changed the title Leader Migration: to beta KEP-2436 Leader Migration: to beta Jul 7, 2021
@jpbetz
Copy link
Contributor

jpbetz commented Jul 7, 2021

Do we need conversions or defautls for v1beta1 like exist for v1alpha1?

@jiahuif
Copy link
Member Author

jiahuif commented Jul 7, 2021

Conversions from/to v1beta1 are generated. Defaults are applied to internal version only.

@jpbetz
Copy link
Contributor

jpbetz commented Jul 7, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2021
@@ -49,5 +50,5 @@ func SetupCurrentKubernetesSpecificFeatureGates(featuregates featuregate.Mutable
// To add a new feature, define a key for it at k8s.io/api/pkg/features and add it here.
var cloudPublicFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
IPv6DualStack: {Default: true, PreRelease: featuregate.Beta},
ControllerManagerLeaderMigration: {Default: false, PreRelease: featuregate.Alpha},
ControllerManagerLeaderMigration: {Default: true, PreRelease: featuregate.Beta},
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should also exist in pkg/features/kube_features.go. (ala IPv6DualStack)

Copy link
Member Author

@jiahuif jiahuif Jul 7, 2021

Choose a reason for hiding this comment

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

We had this discussion when working on alpha. The conclusion was that ControllerManagerLeaderMigration is a feature flag local to staging/controller-manger thus does not need a place in pkg/features/kube_features.go. I do not see a reason to inverse such conclusion during alpha-to-beta graduation. Could you illiterate a bit more why we need it in pkg/features/kube_features.go now?

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 believe we did have a discussion on this in alpha. You did in fact make this assertion during alpha (#99417 (comment)) however I did not agree then and still do not. However as an alpha feature I was unwilling to block based on that alone. For beta I do consider this to be blocking. pkg/feature/kube_features is the master list and if its missing from there it will be missing from places like https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing out the doc. Updating now.

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Copy link
Member

Choose a reason for hiding this comment

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

Are we getting rid of GenericControllerManagerConfiguration (https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/controller-manager/config/v1alpha1/types.go#L25)? If not then I think it should be moving to v1beta1 as well.

Copy link
Member Author

@jiahuif jiahuif Jul 7, 2021

Choose a reason for hiding this comment

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

GenericControllerManagerConfiguration is extracted from common part of corresponding structures of KCM and CCM during the "make staging/controller-manager easier to consume task by @cici37". It is still needed unless we want to rollback any changes during the task. However, GenericControllerManagerConfiguration should not go to v1beta because:

  • The stability is unknown, but it is definitely less than beta
  • We are keeping v1alpha package following convention of how we graduate resources with feature, it would not hurt to keep GenericControllerManagerConfiguration there. There are examples of some resources in a group graduate later than other resources. CronJob goes GA only in 1.21 while others of group batch are GA long before 1.21
  • If we are to graduate GenericControllerManagerConfiguration to beta, it would be far out of scope of this PR. We can do this in a separate PR to avoid scope creeping.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2021
@jiahuif
Copy link
Member Author

jiahuif commented Jul 7, 2021

/assign @cheftako

@jiahuif
Copy link
Member Author

jiahuif commented Jul 7, 2021

/cc @andrewsykim

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2021
@jiahuif
Copy link
Member Author

jiahuif commented Jul 8, 2021

Fixing feature conflicts, 2nd time.

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

/approve

for pkg/features

@jpbetz
Copy link
Contributor

jpbetz commented Jul 8, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2021
@BenTheElder
Copy link
Member

/approve
for vendor/modules.txt

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim, BenTheElder, cheftako, jiahuif

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 Jul 8, 2021
@cheftako
Copy link
Member

cheftako commented Jul 8, 2021

/milestone v1.22

@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jul 8, 2021
@jiahuif
Copy link
Member Author

jiahuif commented Jul 8, 2021

/retest

This feature was in staging/src/k8s.io/controller-manager/pkg/features/kube_features.go but missing here.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2021
@jiahuif
Copy link
Member Author

jiahuif commented Jul 9, 2021

fixing conflicts for the 3rd time.

@jiahuif
Copy link
Member Author

jiahuif commented Jul 9, 2021

/retest

@jpbetz
Copy link
Contributor

jpbetz commented Jul 9, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6075621 into kubernetes:master Jul 9, 2021
@jiahuif jiahuif deleted the feature/leader-migration/to-beta branch July 9, 2021 19:15
tengqm added a commit to tengqm/website that referenced this pull request Jul 11, 2021
Here is a second batch for feature gate updates in 1.22.

- CPUManagerPolicyOptions    kubernetes/kubernetes#101432
- ControllerManagerLeaderMigration  kubernetes/kubernetes#103533
- DelegateFSGroupToCSIDriver   kubernetes/kubernetes#103244
- DynamicKubeletConfig    kubernetes/kubernetes#102966
- EndpointSliceProxying  kubernetes/kubernetes#103451
- EndpointSliceTerminatingCondition  kubernetes/kubernetes#103596
- HugePageStorageMediumSize    kubernetes/kubernetes#99144
- JobTrackingWithFinalizers   kubernetes/kubernetes#98817
  (also tracked in kubernetes#28841, can rebase).
- MemoryQoS   kubernetes/kubernetes#102970
- NodeSwap  kubernetes/kubernetes#102823, kubernetes/kubernetes#103553
- ServiceInternalTrafficPolicy  kubernetes/kubernetes#103462
- StatefulSetAutoDeletePVC kubernetes/kubernetes#99378
- WindowsEndpointSliceProxying   kubernetes/kubernetes#103451

Some of these needs more detailed documentation.
tengqm added a commit to tengqm/website that referenced this pull request Jul 18, 2021
Here is a second batch for feature gate updates in 1.22.

- CPUManagerPolicyOptions    kubernetes/kubernetes#101432
- ControllerManagerLeaderMigration  kubernetes/kubernetes#103533
- DelegateFSGroupToCSIDriver   kubernetes/kubernetes#103244
- DynamicKubeletConfig    kubernetes/kubernetes#102966
- EndpointSliceProxying  kubernetes/kubernetes#103451
- EndpointSliceTerminatingCondition  kubernetes/kubernetes#103596
- HugePageStorageMediumSize    kubernetes/kubernetes#99144
- JobTrackingWithFinalizers   kubernetes/kubernetes#98817
  (also tracked in kubernetes#28841, can rebase).
- MemoryQoS   kubernetes/kubernetes#102970
- NodeSwap  kubernetes/kubernetes#102823, kubernetes/kubernetes#103553
- ServiceInternalTrafficPolicy  kubernetes/kubernetes#103462
- StatefulSetAutoDeletePVC kubernetes/kubernetes#99378
- WindowsEndpointSliceProxying   kubernetes/kubernetes#103451

Some of these needs more detailed documentation.
tengqm added a commit to tengqm/website that referenced this pull request Jul 21, 2021
Here is a second batch for feature gate updates in 1.22.

- CPUManagerPolicyOptions    kubernetes/kubernetes#101432
- ControllerManagerLeaderMigration  kubernetes/kubernetes#103533
- DelegateFSGroupToCSIDriver   kubernetes/kubernetes#103244
- DynamicKubeletConfig    kubernetes/kubernetes#102966
- EndpointSliceProxying  kubernetes/kubernetes#103451
- EndpointSliceTerminatingCondition  kubernetes/kubernetes#103596
- HugePageStorageMediumSize    kubernetes/kubernetes#99144
- JobTrackingWithFinalizers   kubernetes/kubernetes#98817
  (also tracked in kubernetes#28841, can rebase).
- MemoryQoS   kubernetes/kubernetes#102970
- ServiceInternalTrafficPolicy  kubernetes/kubernetes#103462
- StatefulSetAutoDeletePVC kubernetes/kubernetes#99378
- WindowsEndpointSliceProxying   kubernetes/kubernetes#103451

Some of these needs more detailed documentation.
tengqm added a commit to tengqm/website that referenced this pull request Jul 22, 2021
Here is a second batch for feature gate updates in 1.22.

- CPUManagerPolicyOptions    kubernetes/kubernetes#101432
- ControllerManagerLeaderMigration  kubernetes/kubernetes#103533
- DynamicKubeletConfig    kubernetes/kubernetes#102966
- EndpointSliceProxying  kubernetes/kubernetes#103451
- EndpointSliceTerminatingCondition  kubernetes/kubernetes#103596
- HugePageStorageMediumSize    kubernetes/kubernetes#99144
- JobTrackingWithFinalizers   kubernetes/kubernetes#98817
  (also tracked in kubernetes#28841, can rebase).
- MemoryQoS   kubernetes/kubernetes#102970
- ServiceInternalTrafficPolicy  kubernetes/kubernetes#103462
- StatefulSetAutoDeletePVC kubernetes/kubernetes#99378
- WindowsEndpointSliceProxying   kubernetes/kubernetes#103451

Some of these needs more detailed documentation.
tengqm added a commit to tengqm/website that referenced this pull request Jul 23, 2021
Here is a second batch for feature gate updates in 1.22.

- CPUManagerPolicyOptions    kubernetes/kubernetes#101432
- ControllerManagerLeaderMigration  kubernetes/kubernetes#103533
- DynamicKubeletConfig    kubernetes/kubernetes#102966
- EndpointSliceProxying  kubernetes/kubernetes#103451
- EndpointSliceTerminatingCondition  kubernetes/kubernetes#103596
- HugePageStorageMediumSize    kubernetes/kubernetes#99144
- JobTrackingWithFinalizers   kubernetes/kubernetes#98817
  (also tracked in kubernetes#28841, can rebase).
- ServiceInternalTrafficPolicy  kubernetes/kubernetes#103462
- WindowsEndpointSliceProxying   kubernetes/kubernetes#103451

Some of these needs more detailed documentation.
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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants