Skip to content

Conversation

@kkmsft
Copy link
Contributor

@kkmsft kkmsft commented Jan 14, 2020

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 14, 2020
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/windows Categorizes an issue or PR as relevant to SIG Windows. labels Jan 14, 2020
Copy link
Contributor

@michmike michmike left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 14, 2020
@Random-Liu
Copy link
Member

/lgtm

This looks good to me.

@PatrickLang
Copy link
Contributor

/assign @mikebrow
/assign @Random-Liu

The runtimeHandler annotation will be based on the Runtime Class specified by the user:
```
“runtimehandler”: “<corresponding values>”
Copy link
Member

Choose a reason for hiding this comment

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

Can we also add kubernetes.io domain?

Copy link
Contributor

Choose a reason for hiding this comment

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

as in kubernetes.io/runtimehandler ?

Copy link
Member

Choose a reason for hiding this comment

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

Suggest adding a note with a link to the oci annotations for the oci image spec... https://github.com/opencontainers/image-spec/blob/master/annotations.md#annotations given that oci reserves org.opencontainers.image domain

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think kubernetes.io/runtimehandler sounds good to me. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

those annotations are bit different scope though - they're stored in the container manifest. We're talking about changing CRI, not OCI

Copy link
Member

Choose a reason for hiding this comment

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

right just a mention regarding another reserved annotation domain for these annotations.

“kubernetes.io/os”: ”linux”
```
Note that these are currently arrived from GOARCH and GOOS at runtime, which does not reflect the image which needs to be pulled but instead corresponds to the system on which kubelet is running. The runtime handler specified in the annotation will provide more accurate indication of the user intend to the runtime.
Copy link

@jterry75 jterry75 Jan 14, 2020

Choose a reason for hiding this comment

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

'these are currently derived'

Copy link
Member

Choose a reason for hiding this comment

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

s/intend/intent/

Copy link
Member

Choose a reason for hiding this comment

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

I thought someone would jut make new runtime handler configs to indicate if they wanted a particular arch/os/variant.. Seems odd to have runtime handler be a first class string then switches on the handler be a suggested annotation evaluated by container runtimes... Maybe just mention that this is a temporary soln to use annotations for this arch/os/variant selection pattern..

Copy link
Member

Choose a reason for hiding this comment

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

another example of use is where we need per container runtime container image cache storage policies passed to the integration. For example: kubernetes.io/cache_image = "node", "pod", "container", "userid", "groupid", ...
In this example "node" is the default where images pulled on the node are cacheable... "pod" would mean one cache per pod no sharing of images across pods... etc... TBD for details based on container image policy kep WIP.

@jterry75
Copy link

@Random-Liu - Is there any expectation at all that on ImageSpec return values from *Stats* and List* style functions that there be annotations? IE: Are the annotations only for *Request input to various functions and not used for *Response

We could potentially also add the kubernetes specification annotations for consideration of the runtime:
```
“kubernetes.io/arch”: “amd64”
“kubernetes.io/os”: ”linux”

Choose a reason for hiding this comment

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

Should we define these in the kubernetes.io/image/* namespace?

Choose a reason for hiding this comment

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

And have:
.../arch
.../os
.../variant
as known values?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good point. I see why this is confusing. Today we already have well-known labels applied to the node by the kubelet doc

  • kubernetes.io/os
  • kubernetes.io/arch

Those are intended to be used for scheduling as nodeSelectors, not for determining what image to pull.

In this KEP I propose to encode a user's desired os/arch as part of the RuntimeClass. This may be different from the node labels above, so it would be good to use different names. RuntimeClass is the only thing passed in the pod sandbox config. I think for image/* to be useful, we'd need matching ones in the pod sandbox config too.

Choose a reason for hiding this comment

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

Ah I see. Ok then yes we will just have one known annotation kubernetes.io/runtimehandler that is passed in the ImageSpec.Annotations. Thanks

Copy link
Member

Choose a reason for hiding this comment

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

Should we define these in the kubernetes.io/image/* namespace?

Only one / is allowed for Kubernetes annotation, we may want to follow the same rule.
https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set

@Random-Liu
Copy link
Member

Is there any expectation at all that on ImageSpec return values from Stats and List* style functions that there be annotations? IE: Are the annotations only for *Request input to various functions and not used for *Response

I think we should return the annotation in all Responses.

We may want to make that clear in the doc.

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

See comments.


#### Adding handler to CRI pull API

> As per discussions in sig-node meetings based on the PR https://github.com/kubernetes/kubernetes/pull/84486, this approach will no longer be considered. An alternate approach to add annotations to the ImageSpec will be path taken.
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 we can just delete this section since it's no longer being considered and delete other lines discussing handler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will remove

The runtimeHandler annotation will be based on the Runtime Class specified by the user:
```
“runtimehandler”: “<corresponding values>”
Copy link
Member

Choose a reason for hiding this comment

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

Suggest adding a note with a link to the oci annotations for the oci image spec... https://github.com/opencontainers/image-spec/blob/master/annotations.md#annotations given that oci reserves org.opencontainers.image domain

“kubernetes.io/os”: ”linux”
```
Note that these are currently arrived from GOARCH and GOOS at runtime, which does not reflect the image which needs to be pulled but instead corresponds to the system on which kubelet is running. The runtime handler specified in the annotation will provide more accurate indication of the user intend to the runtime.
Copy link
Member

Choose a reason for hiding this comment

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

s/intend/intent/

“kubernetes.io/os”: ”linux”
```
Note that these are currently arrived from GOARCH and GOOS at runtime, which does not reflect the image which needs to be pulled but instead corresponds to the system on which kubelet is running. The runtime handler specified in the annotation will provide more accurate indication of the user intend to the runtime.
Copy link
Member

Choose a reason for hiding this comment

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

I thought someone would jut make new runtime handler configs to indicate if they wanted a particular arch/os/variant.. Seems odd to have runtime handler be a first class string then switches on the handler be a suggested annotation evaluated by container runtimes... Maybe just mention that this is a temporary soln to use annotations for this arch/os/variant selection pattern..

“kubernetes.io/os”: ”linux”
```
Note that these are currently arrived from GOARCH and GOOS at runtime, which does not reflect the image which needs to be pulled but instead corresponds to the system on which kubelet is running. The runtime handler specified in the annotation will provide more accurate indication of the user intend to the runtime.
Copy link
Member

Choose a reason for hiding this comment

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

another example of use is where we need per container runtime container image cache storage policies passed to the integration. For example: kubernetes.io/cache_image = "node", "pod", "container", "userid", "groupid", ...
In this example "node" is the default where images pulled on the node are cacheable... "pod" would mean one cache per pod no sharing of images across pods... etc... TBD for details based on container image policy kep WIP.

This will be reviewed with contributors from both Kubernetes and ContainerD and tested together while Windows support in CRI-ContainerD is still in development. As this is an optional field today in `RunPodSandboxRequest`, there's no risk if someone wants to not specify it in `RuntimeClass`. In that case ContainerD will use the default configuration for pull, create sandbox, and so on.
#### Adding annotations to ImageSpec
These annotation will be an optional parameter and default configuration is used by `ContainerD`(or any other runtime involved) when no annotations are specified.
Copy link
Member

Choose a reason for hiding this comment

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

s/annotation/annotations/

Support for annotations will be on a container runtime implementation basis. A table should be built by each container runtime mentioning which annotations are supported by CR version.

I don't think we can "force" annotation support.... unless we want to have an api querying for a list of supported annotations from the CR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have reframed the words to reflect this.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 28, 2020
@kkmsft kkmsft force-pushed the kkmsft-patch-1 branch 2 times, most recently from e5bdec4 to 427fc40 Compare January 28, 2020 19:40
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 28, 2020
@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 28, 2020

@Random-Liu @PatrickLang - Have update the ImageSpec usage in List. PTAL.

@PatrickLang
Copy link
Contributor

/LGTM
/hold
Can remove hold once @Random-Liu has reviewed

@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 Jan 28, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2020
@kkmsft kkmsft requested a review from Random-Liu January 28, 2020 21:57
// the local storage. It returns ("", nil) if the image isn't in the local storage.
GetImageRef(image ImageSpec) (string, error)
// Gets all images currently on the machine.
ListImages() ([]ImageSpec, error)
Copy link
Member

Choose a reason for hiding this comment

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

ListImages should continue return Images, we just need to add ImageSpec information into Image.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok - can we work out the specifics of that during phase 2 PR? We don't have the background on why Image and ImageSpec are different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks you @Random-Liu . I have modified the struct Image to include the ImageSpec in the updated PR. Please have a look - @Random-Liu @PatrickLang

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok - that makes sense

Copy link
Contributor

Choose a reason for hiding this comment

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

/lgtm
/hold
(remove once @Random-Liu ok with final update)

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2020
@Random-Liu
Copy link
Member

/lgtm

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

/lgtm
/approve

@PatrickLang
Copy link
Contributor

/cancel hold

@PatrickLang
Copy link
Contributor

/lgtm
/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 Jan 28, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, kkmsft, michmike, PatrickLang, 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 merged commit fe9b215 into kubernetes:master Jan 28, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Jan 28, 2020
@kkmsft kkmsft deleted the kkmsft-patch-1 branch April 16, 2020 19:03
ingvagabund pushed a commit to ingvagabund/enhancements that referenced this pull request Feb 26, 2025
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 lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants