Skip to content

cilium-cli: Migrate from corev1.Endpoints to discoveryv1.EndpointSlice #39364

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

HadrienPatte
Copy link
Member

corev1.Endpoints is deprecated in v1.33+
discoveryv1.EndpointSlice is stable since v1.21


Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!
cilium-cli: Migrate from `corev1.Endpoints` to `discoveryv1.EndpointSlice`

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 6, 2025
@github-actions github-actions bot added cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary labels May 6, 2025
@HadrienPatte
Copy link
Member Author

/test

@HadrienPatte HadrienPatte marked this pull request as ready for review May 6, 2025 12:45
@HadrienPatte HadrienPatte requested review from a team as code owners May 6, 2025 12:45
@gandro
Copy link
Member

gandro commented May 6, 2025

Pinging @aanm because I think Cilium 1.18 still will K8s <1.33 where endpoints haven't been deprecated yet

@gandro gandro added area/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers. release-note/misc This PR makes changes that have no direct user impact. labels May 6, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 6, 2025
@HadrienPatte
Copy link
Member Author

I think it should be fine as long as clusters are on kubernetes v1.21+ to have endpointslices, see example from a v1.31 cluster:

$ k version
Server Version: v1.31.6
$ k get endpoints
NAME                              ENDPOINTS                                                              AGE
cluster-autoscaler                10.131.54.22:8085,10.131.55.99:8085                                    112d
$ k get endpointslices
NAME                               ADDRESSTYPE   PORTS       ENDPOINTS                     AGE
cluster-autoscaler-nv2tz           IPv4          8085        10.131.54.22,10.131.55.99     112d

@gandro
Copy link
Member

gandro commented May 7, 2025

According to @aanm it is possible that users might still have endpoint slices disabled on 1.32 and older.

Having said that, it's probably fine to merge this, as long as we mention it in the release notes.

@tklauser
Copy link
Member

@HadrienPatte could you please rebase this PR branch? This should fix the failing GitHub Workflow Related Checks / Validate Workflow Names check.

…lice`

`corev1.Endpoints` is deprecated in v1.33+
`discoveryv1.EndpointSlice` is stable since v1.21

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
@HadrienPatte HadrienPatte force-pushed the cilium-cli-endpointslices branch from f9a8083 to 0e36d25 Compare May 13, 2025 13:03
@HadrienPatte
Copy link
Member Author

/test

@tklauser tklauser enabled auto-merge May 13, 2025 13:05
@tklauser tklauser added this pull request to the merge queue May 14, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 14, 2025
Merged via the queue into cilium:main with commit 672da22 May 14, 2025
77 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers. cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants