Skip to content

DRA API: remove obsolete types from v1alpha3 #132000

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
Jun 12, 2025

Conversation

pohly
Copy link
Contributor

@pohly pohly commented May 28, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The v1alpha3 version is still needed for DeviceTaintRule, but the rest of the types and most structs became obsolete in v1.32 when we introduced v1beta1 and bumped the storage version to v1beta1.

Removing them now simplifies adding new features because new fields don't need to be added to these obsolete types. This could have been done already in 1.33, but wasn't to minimize disrupting on-going work.

Which issue(s) this PR fixes:

Related-to: kubernetes/enhancements#4381, #131903

Does this PR introduce a user-facing change?

DRA API: resource.k8s.io/v1alpha3 now only contains DeviceTaintRule. All other types got removed because they became obsolete when introducing the v1beta1 API in 1.32.
ACTION REQUIRED: before updating a cluster where resourceclaims, resourceclaimtemplates, deviceclasses, or resourceslices might have been stored using Kubernetes < 1.32, delete all of those resources before updating and recreate them as needed while running Kubernetes >= 1.32.

/assign @mortent

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. 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. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 28, 2025
@k8s-ci-robot
Copy link
Contributor

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added 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 May 28, 2025
@k8s-ci-robot k8s-ci-robot requested review from bart0sh and deads2k May 28, 2025 10:08
@k8s-ci-robot k8s-ci-robot added area/code-generation area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. labels May 28, 2025
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. wg/device-management Categorizes an issue or PR as relevant to WG Device Management. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 28, 2025
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@pohly pohly force-pushed the dra-api-alpha3-removal branch from 8cd65f5 to 7255199 Compare May 28, 2025 10:35

// The device this taint is attached to has the "effect" on
// any claim which does not tolerate the taint and, through the claim,
// to pods using the claim.
//
// +protobuf.options.(gogoproto.goproto_stringer)=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.

This aligns the v1alpha3 API with how the beta APIs define DeviceTaint.

This goes a bit beyond "obsolete type removal", I just happened to run into this.

@pohly pohly moved this from 🆕 New to 👀 In review in Dynamic Resource Allocation May 28, 2025
@pohly pohly force-pushed the dra-api-alpha3-removal branch from 7255199 to d3d2fce Compare May 28, 2025 14:04
@k8s-ci-robot k8s-ci-robot added sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels May 28, 2025
@k8s-ci-robot k8s-ci-robot requested a review from mortent June 6, 2025 10:10
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2025
@k8s-ci-robot
Copy link
Contributor

@pohly: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-apidiff-client-go 10de678 link false /test pull-kubernetes-apidiff-client-go

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

@cici37
Copy link
Contributor

cici37 commented Jun 10, 2025

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 10, 2025
@liggitt liggitt added this to the v1.34 milestone Jun 10, 2025
@liggitt
Copy link
Member

liggitt commented Jun 11, 2025

Anyone who enabled DRA stuff while in v1alpha3, and upgraded their cluster since then without doing any storage migrations needs to run a storage migration on DRA types before upgrading to 1.34 which includes this PR. That's fair game since this is an alpha version, but should be release noted.

@liggitt
Copy link
Member

liggitt commented Jun 11, 2025

/lgtm
/approve

one question about the test file, and please update the release note

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

LGTM label has been added.

Git tree hash: 05c7f7b5ef5490bea9bb67f38c8012823751d920

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, pohly

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 Jun 11, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2025
@liggitt liggitt moved this to API review completed, 1.34 in API Reviews Jun 11, 2025
@pohly
Copy link
Contributor Author

pohly commented Jun 11, 2025

needs to run a storage migration on DRA types before upgrading to 1.34

Do we have some standard instructions for doing this?

@liggitt
Copy link
Member

liggitt commented Jun 11, 2025

needs to run a storage migration on DRA types before upgrading to 1.34

Do we have some standard instructions for doing this?

Hmm... I thought we did, but all I'm finding is https://kubernetes.io/docs/tasks/manage-kubernetes-objects/storage-version-migration/ which is the alpha controller-driven feature.

Conceptually, a no-op patch of every instance would accomplish what we need.

Something like this does it, but is gorpy / weird to document as the "official" way to do a manual storage migration:

kubectl get resourceslices,resourceclaims,deviceclasses,resourceclaimtemplates,devicetaintrules -A -o json \
   | jq -r '.items[] | "-n \(.metadata.namespace) \(.kind)s/\(.metadata.name)"' \
   | xargs -L 1 kubectl patch  --type=merge --patch='{}'

@liggitt
Copy link
Member

liggitt commented Jun 11, 2025

needs to run a storage migration on DRA types before upgrading to 1.34

Do we have some standard instructions for doing this?

Hmm... I thought we did, but all I'm finding is https://kubernetes.io/docs/tasks/manage-kubernetes-objects/storage-version-migration/ which is the alpha controller-driven feature.

cc @deads2k for visibility ... probably should have storage migration procedures documented

@pohly
Copy link
Contributor Author

pohly commented Jun 12, 2025

Considering that this only affects users of Kubernetes < 1.32 and only if they enabled an alpha feature, I think we can go for "delete all of these types before an update".

/release-note-edit

DRA API: resource.k8s.io/v1alpha3 now only contains DeviceTaintRule. All other types got removed because they became obsolete when introducing the v1beta1 API in 1.32.
ACTION REQUIRED: before updating a cluster where resourceclaims, resourceclaimtemplates, deviceclasses, or resourceslices might have been stored using Kubernetes < 1.32, delete all of those resources before updating and recreate them as needed while running Kubernetes >= 1.32.

@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jun 12, 2025
@liggitt
Copy link
Member

liggitt commented Jun 12, 2025

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit 7e94ec9 into kubernetes:master Jun 12, 2025
17 of 18 checks passed
@github-project-automation github-project-automation bot moved this from Archive-it to Done in SIG Node CI/Test Board Jun 12, 2025
@pohly pohly moved this from 👀 In review to ✅ Done in Dynamic Resource Allocation Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.
Projects
Status: API review completed, 1.34
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants