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

apiserver endpointslice reconciler should be smarter about what slices it owns #101070

Open
danwinship opened this issue Apr 13, 2021 · 7 comments
Assignees
Labels
area/apiserver kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@danwinship
Copy link
Contributor

Currently the apiservers create an Endpoints object and an EndpointSlice object named "kubernetes", and ensure that those objects remain in sync with the actual set of running apiservers.

In particular, it only ever looks at the EndpointSlice named "kubernetes", and not any other EndpointSlices. This could lead to problems when trying introduce dual-stack support for the apiserver:

  1. User creates a dual-stack 1.21 cluster; the "kubernetes" service is single-stack, and advertises only IPv4 endpoints in Endpoints and EndpointSlice.
  2. User initiates an upgrade to release 1.22, where (hypothetically) dual-stack apiserver is supported
  3. The first 1.21 apiserver stops, removing its IPv4 address from the "kubernetes" Endpoints and EndpointSlice
  4. The first apiserver starts up again at version 1.22, adds its IPv4 address back to the "kubernetes" Endpoints and EndpointSlice, and creates a new "kubernetes-ipv6" EndpointSlice (or something) containing its IPv6 address.
  5. The apiserver then crashes due to a bug. The upgrade stalls, and the user decides to abort and downgrade back to 1.21
  6. The apiserver starts up again at version 1.21, finds that its IP is already in the "kubernetes" Endpoints and EndpointSlice, and so does nothing else
  7. At this point, there is a stray "kubernetes-ipv6" EndpointSlice object which no one owns, pointing to an IPv6 address which may or may not actually be usable (and which will definitely not remain usable forever even if it is usable now).

It seems like the apiserver EndpointSlice reconciling code ought to be smarter, and consider itself the owner of all EndpointSlices that have an OwnerReference pointing to the apiserver Service. (Though note that it's not currently setting OwnerReference.) Then in step 6 above, the 1.21 apiserver would delete the stray "kubernetes-ipv6" EndpointSlice that had been created by its 1.22 self. (This approach would cause flapping during upgrade, where the old apiservers would keep deleting the IPv6 EndpointSlice created by the new apiservers, but that would only be a transient problem while the upgrade was in progress, and would eventually resolve (correctly) one way or the other once the cluster stabilizes at a single version.)

/cc @robscott
/sig network
/area apiserver

@danwinship danwinship added the kind/bug Categorizes issue or PR as related to a bug. label Apr 13, 2021
@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. area/apiserver labels Apr 13, 2021
@k8s-ci-robot
Copy link
Contributor

@danwinship: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 13, 2021
@thockin thockin removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 15, 2021
@aojea
Copy link
Member

aojea commented May 11, 2021

related kubernetes/enhancements#2622

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 9, 2021
@aojea
Copy link
Member

aojea commented Aug 9, 2021

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 9, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 8, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 8, 2021
@danwinship
Copy link
Contributor Author

/remove-lifecycle rotten
/lifecycle frozen
/assign
(will end up fixing this as part of the dual-stack apiserver work)

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants