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-4794: initial proposal for deprecating v1.Endpoints #4975

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danwinship
Copy link
Contributor

The `v1.Endpoints` API has been essentially deprecated since
EndpointSlices became GA in 1.21. Several new Service features (such
as dual-stack and topology, not to mention "services with more than
1000 endpoints") are implemented only for EndpointSlice, not for
Endpoints. Kube-proxy no longer uses Endpoints ever, for anything, and
the Gateway API conformance tests also require implementations to use
EndpointSlices.

Despite this, kube-controller-manager still does all of the work of
managing Endpoints objects for all Services, and a cluster cannot pass
the conformance test suite unless the Endpoints and EndpointSlice
Mirroring controllers are running, even though in many cases nothing
will ever look at the output of the Endpoints controller (and the
EndpointSlice Mirroring controller will never output anything).

While Kubernetes's API guarantees make it essentially impossible to
ever actually fully remove Endpoints, we should at least move toward a
world where most users run Kubernetes with the Endpoints and
EndpointSlice Mirroring controllers disabled.

#4974

/sig network
/cc @aojea @robscott

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Nov 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 22, 2024
@danwinship danwinship mentioned this pull request Nov 22, 2024
4 tasks
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Some feedback

Comment on lines +104 to +106
- Ensure that all documentation reflects the fact that the Endpoints
API is deprecated and should not be used by new code, and that
Endpoints objects might not be created or mirrored in some clusters.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Ensure that all documentation reflects the fact that the Endpoints
API is deprecated and should not be used by new code, and that
Endpoints objects might not be created or mirrored in some clusters.
- Ensure that end users favor EndpointSlice over Endpoints, and understand that the
Endpoints API is deprecated.

Comment on lines +108 to +109
- Add apiserver warnings when users (other than the Endpoints
controller) create Endpoints objects.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Add apiserver warnings when users (other than the Endpoints
controller) create Endpoints objects.
- Serve warnings (`Warning:` headers) when users, other than the Endpoints
controller, create Endpoints objects.

Not sure this is a goal - that's more of a “how will we achieve“. But I'm not outright opposed to leaving it in.

Comment on lines +111 to +144
- Update the e2e test suite to ensure that all tests that care about
endpoints only as a generic concept are using EndpointSlices rather
than Endpoints. (For example, the utility function
`framework.WaitForServiceEndpointsNum` should check that
EndpointSlices exist, not that Endpoints exist).

- Adjust the conformance test suite to not require the Endpoints and
EndpointSlice Mirroring controllers to be running:

- Fix tests such as `Service endpoints latency should not be very
high` to check the latency of EndpointSlices rather than
Endpoints, since that is what is actually important in
real-world usage.

- Demote tests such as `EndpointSliceMirroring should mirror a
custom Endpoints resource through create update and delete` to
non-conformance.

- Split up tests such as `EndpointSlice should create Endpoints
and EndpointSlices for Pods matching a Service` into a
conformance test for EndpointSlice and a non-conformance test
for Endpoints.

- Update the e2e test suite so that all remaining tests that depend on
the outputs of the Endpoints or EndpointSlice Mirroring controllers
are feature-tagged so they can be skipped in clusters that do not
run those controllers, and set up a periodic e2e job running in such
a configuration.

- Explicitly document that disabling `endpoints-controller` and/or
`endpointslice-mirroring-controller` via kube-controller-manager's
`--controllers` flag is a supported and conforming configuration.

- Figure out what to do with stale Endpoints in such a cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

These seems like a really long Goals section. How about

- ensure that Conformance doesn't require a running controller that writes Endpoints objects

- reduce the end to end tests for Endpoints, to the minimum tests required to support Endpoints as a
  stable (but deprecated) API

- design, implement and document cleanup for stale Endpoints in clusters that still have these
  objects present

controllers via kube-controller-manager's `--controllers` option, and
we believe that this will have no ill effects in a vanilla Kubernetes
cluster (though, currently, it will cause the e2e tests to fail).

Copy link
Contributor

Choose a reason for hiding this comment

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

If a controller is (still) making Endpoints objects, do we want to surface that somehow once the API is deprecated?

eg: .status on the associated Service?

Comment on lines +196 to +219
We do not want to leave stale `Endpoints` objects around forever if
the associated controllers are not running. (This is both a waste of
disk space and a potential source of confusion since the Endpoints
objects would quickly become out-of-date and incorrect.)

One possibility would be to just document that administrators should
delete all existing Endpoints themselves if they are going to disable
the controllers.

Another possibility would be to have kube-controller-manager do this
automatically. (Though the idea of having it automatically take action
because a controller _isn't_ enabled seems slightly magical? But
perhaps there is precedent somewhere else?)

Another possibility would be to create an `endpoints-cleanup`
controller, that could be enabled explicitly, and document that admins
should (probably) enable that controller if they disable the others.

Or perhaps the EndpointSlice controller could delete Endpoints objects
that were more than 24 hours out of date with respect to their
EndpointSlices?

In all cases, we should probably not automatically delete Endpoints
that were not originally created by the Endpoints controller.
Copy link
Contributor

Choose a reason for hiding this comment

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

We could mark this as an unresolved point.

### Graduation Criteria

#### Alpha

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Deprecate the Endpoints API

Comment on lines +371 to +373
- The documentation explains how to disable the Endpoints and
EndpointSlice Mirroring controllers, but warns that third-party
components may still depend on them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Bear in mind that in managed Kubernetes, people who use the cluster may have no way to disable these controllers.


- <test>: <link to test coverage>

### Graduation Criteria
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not looking to graduate to GA here. This is a deprecation plan.

Comment on lines +26 to +30
# The milestone at which this feature was, or is targeted to be, at each stage.
milestone:
alpha: "v1.33"
beta: "v1.35"
stable: "v1.37"
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not planning to graduate to stable. This is a deprecation plan.

- "/keps/sig-network/0752-endpointslices"

# The target maturity stage in the current dev cycle for this KEP.
stage: alpha
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not planning to graduate to stable. This is a deprecation plan.


- We have a passing "no Endpoints" e2e job.

- Warnings are emitted when users create Endpoints.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe kubectl also warns on get / list, provided the API server doesn't serve an actual warning instead?

Just a thought.

Comment on lines +149 to +154
- MAYBE change kube-apiserver to optionally not generate Endpoints for
kubernetes.default, though this would require adding a
kube-apiserver configuration option, and the benefit from removing
just that 1 Endpoints object is small. Perhaps instead it could just
add an annotation to the object pointing out the fact that Endpoints
is deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

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

From experience, I can say that it would make teaching easier if there were an EndpointSlice for the kubernetes Service in the default namespace.

If we deprecate, we should mean it.

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/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/network Categorizes an issue or PR as relevant to SIG Network. 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.

3 participants