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

Add annotations to CRI ImageSpec objects #90061

Merged

Conversation

marosset
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:
This PR adds Annotations to the ImageSpec object in CRI api.

The expectation is that for Windows in order to use non-default runtime classes Pods would specify a kubernetse.io/runtimehandler annotation. This would get passed to the CRI and used during various image pull and sandbox creation operations.
This behavior would be optional and would need to be implemented for each CRI independently.

Usage and more information can be found here: https://github.com/kubernetes/enhancements/blob/master/keps/sig-windows/windows-runtimeclass-support.md#adding-annotations-to-imagespec

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add Annotations to CRI-API ImageSpec objects.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

KEP:

[KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-windows/windows-runtimeclass-support.md

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 10, 2020
@marosset
Copy link
Contributor Author

/sig windows

@k8s-ci-robot k8s-ci-robot added sig/windows Categorizes an issue or PR as relevant to SIG Windows. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 10, 2020
@marosset marosset added this to In Progress (v1.19) in SIG-Windows Apr 13, 2020
@matthyx
Copy link
Contributor

matthyx commented Apr 14, 2020

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from matthyx April 14, 2020 04:56
@marosset marosset force-pushed the runtimehandler-image-spec-annotations branch from d1ffcf4 to 99ecbd7 Compare April 18, 2020 00:03
@marosset marosset force-pushed the runtimehandler-image-spec-annotations branch from 99ecbd7 to 9036772 Compare April 20, 2020 22:26
@marosset marosset changed the title [WIP] Runtimehandler image spec annotations Add annotations to CRI ImageSpec objects Apr 20, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 20, 2020
@marosset
Copy link
Contributor Author

/retest

@marosset
Copy link
Contributor Author

/cc @Random-Liu @yujuhong @tallclair @kkmsft @jterry75
This PR attempts to implement the outcomes of discussions relating to #84486 which you all commented on.
Can you take a look when when you get a chance?

// Unstructured key-value map holding arbitrary metadata.
// ImageSpec Annotations can be used to help the runtime target specific
// images in multi-arch images.
map<string, string> annotations = 2;
Copy link

Choose a reason for hiding this comment

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

Will this change make it into k8s.io/cri-api? That's where we get the CRI spec for our code.

Copy link
Member

Choose a reason for hiding this comment

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

yep, it would

@marosset
Copy link
Contributor Author

/assign @Random-Liu @dchen1107 @derekwaynecarr PTAL

@k8s-ci-robot
Copy link
Contributor

@marosset: GitHub didn't allow me to assign the following users: PTAL.

Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @Random-Liu @dchen1107 @derekwaynecarr PTAL

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.


spec := kubecontainer.ImageSpec{
Image: image,
Annotations: podAnnotations,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there annotation that needs to be filtered before passing to ImageSpec ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It won't hurt anything to include all Pod annotations here and let the CRI/containerd pick which ones to use so I figured it would be cleaner here to just pass them all along.
I can update to include filtering if necessary - but that would require code updates in k/k to pass along other annotations in the future.
What does everyone think?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's hard to determine which annotations should be filtered. let's just pass all?

@saschagrunert
Copy link
Member

/cc

@fuweid
Copy link
Contributor

fuweid commented May 2, 2020

/cc

@k8s-ci-robot
Copy link
Contributor

@fuweid: GitHub didn't allow me to request PR reviews from the following users: fuweid.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc

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.

@marosset
Copy link
Contributor Author

marosset commented May 5, 2020

@feiskyer - could you take a look?

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

looks good

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2020
@derekwaynecarr
Copy link
Member

discussed in sig-node on 5/5, @dchen1107 to follow up with @Random-Liu

@derekwaynecarr
Copy link
Member

@dchen1107 @Random-Liu were you able to review?

@Random-Liu
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marosset, Random-Liu

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 May 18, 2020
@marosset
Copy link
Contributor Author

/test pull-kubernetes-files-remake

@k8s-ci-robot k8s-ci-robot merged commit f411271 into kubernetes:master May 18, 2020
SIG-Windows automation moved this from In Review (v1.19) to Done (v1.18) May 18, 2020
@marosset marosset deleted the runtimehandler-image-spec-annotations branch June 4, 2020 18:43
@marosset marosset moved this from Done (v1.18) to Done (v1.19) in SIG-Windows Jun 23, 2020
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet