-
Notifications
You must be signed in to change notification settings - Fork 110
Enable DRA device metadata (KEP-5304) #164
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
Draft
carlory
wants to merge
2
commits into
kubernetes-sigs:main
Choose a base branch
from
carlory:kep-5304-enable-device-metadata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .cache/ | ||
| .config/ | ||
| vendor/ | ||
| [._]*.sw[a-p] | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # One pod, one container | ||
| # Verifies in-container device metadata for directly referenced ResourceClaims (KEP-5304) | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: gpu-test10 | ||
|
|
||
| --- | ||
| apiVersion: resource.k8s.io/v1 | ||
| kind: ResourceClaim | ||
| metadata: | ||
| namespace: gpu-test10 | ||
| name: single-gpu | ||
| spec: | ||
| devices: | ||
| requests: | ||
| - name: gpu | ||
| exactly: | ||
| deviceClassName: gpu.example.com | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| namespace: gpu-test10 | ||
| name: pod0 | ||
| labels: | ||
| app: pod | ||
| spec: | ||
| containers: | ||
| - name: ctr0 | ||
| image: ubuntu:22.04 | ||
| command: ["bash", "-c"] | ||
| args: ["export; trap 'exit 0' TERM; sleep 9999 & wait"] | ||
| resources: | ||
| claims: | ||
| - name: gpu | ||
| resourceClaims: | ||
| - name: gpu | ||
| resourceClaimName: single-gpu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # One pod, one container | ||
| # Verifies in-container device metadata for ResourceClaimTemplate-based claims (KEP-5304) | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: gpu-test9 | ||
|
|
||
| --- | ||
| apiVersion: resource.k8s.io/v1 | ||
| kind: ResourceClaimTemplate | ||
| metadata: | ||
| namespace: gpu-test9 | ||
| name: single-gpu | ||
| spec: | ||
| spec: | ||
| devices: | ||
| requests: | ||
| - name: gpu | ||
| exactly: | ||
| deviceClassName: gpu.example.com | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| namespace: gpu-test9 | ||
| name: pod0 | ||
| labels: | ||
| app: pod | ||
| spec: | ||
| containers: | ||
| - name: ctr0 | ||
| image: ubuntu:22.04 | ||
| command: ["bash", "-c"] | ||
| args: ["export; trap 'exit 0' TERM; sleep 9999 & wait"] | ||
| resources: | ||
| claims: | ||
| - name: gpu | ||
| resourceClaims: | ||
| - name: gpu | ||
| resourceClaimTemplateName: single-gpu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ kubeletPlugin: | |
| affinity: {} | ||
| kubeletRegistrarDirectoryPath: /var/lib/kubelet/plugins_registry | ||
| kubeletPluginsDirectoryPath: /var/lib/kubelet/plugins | ||
| enableDeviceMetadata: false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we update the e2e tests to enable and exercise this flag? #153 refactors all of the e2e logic but I think that will merge soon, so you may want to hold off on that until that merges. |
||
| containers: | ||
| init: | ||
| securityContext: {} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1.36.0 is unavailable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could set
BUILD_KIND_IMAGEbased on whether$KIND_IMAGEexists instead of a static true/false.dra-example-driver/demo/scripts/common.sh
Lines 41 to 44 in a538bc8
I've noticed resource constraint issues with building the kind image from source in CI. Then we could refactor
demo/scripts/build-kind-image.shto allow building the image from release artifacts. We would need a way to pass--type release <version>here instead of a file path to the cloned repo:dra-example-driver/demo/scripts/build-kind-image.sh
Line 55 in a538bc8
A generic variable like
KIND_BUILD_NODE_IMAGE_ARGSis probably good enough to handle a variety of use cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying this out in #188.