Skip to content

Add a new container runtime interface#25899

Merged
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
yujuhong:ncri
Jul 1, 2016
Merged

Add a new container runtime interface#25899
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
yujuhong:ncri

Conversation

@yujuhong

Copy link
Copy Markdown
Contributor

This PR includes a proposal and a Go file to re-define the container runtime interface.
This is based on the original doc: https://docs.google.com/document/d/1ietD5eavK0aTuMQTw6-21r67UU73_vqYSUIPFdA0J5Q/

The umbrella issues is #22964

/cc @kubernetes/sig-node

@yujuhong yujuhong added the sig/node Categorizes an issue or PR as relevant to SIG Node. label May 19, 2016
@k8s-github-robot k8s-github-robot added kind/design Categorizes issue or PR as related to design. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-label-needed labels May 19, 2016
@vishh

vishh commented May 19, 2016

Copy link
Copy Markdown
Contributor

cc @mrunalp

@dchen1107

Copy link
Copy Markdown
Member

cc/ @philips @jonboulle @yifan-gu @euank from coreos / rkt
cc/ @smarterclayton @derekwaynecarr @timothysc @mrunalp from redhat and runc integration
cc/ @feiskyer @resouer from hyper.sh and hyperd integration
cc/ @krobertson from Apcera

@yifan-gu

Copy link
Copy Markdown
Contributor

cc @tmrts @s-urbaniak

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: spacing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will fix it. thanks

@vishh

vishh commented May 19, 2016

Copy link
Copy Markdown
Contributor

@yujuhong Would it be useful to mention explicitly that this PR is not intended to be the final API / interface and that the individual fields/features can be fixed/updated/improved in subsequent PRs?

Comment thread pkg/kubelet/container/interface.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should probably include paths to all shared namespaces for completeness.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can approach this in two different ways. One is, as you suggested, returning everything for completeness. The other is to add fields when we need it. I went with the second approach, and we can iterate and add more fields if required.

@k8s-bot

k8s-bot commented Jul 1, 2016

Copy link
Copy Markdown

GCE e2e build/test passed for commit 96c0103455f27a974085e9a2fc4148f669ac4dec.

@tmrts

tmrts commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

It seems like I wasn't able to communicate my intentions well. I meant addressing the comments of other people so that theirs don’t get lost and carry the discussion about my concerns to another PR. I agree with 100% with the recent comments 👍

This commit includes a proposal and a Go file to re-define the container
runtime interface.

Note that this is an experimental interface and is expected to go through
multiple revisions once developers start implementing against it. As stated in
the proposal, there are also individual issues to carry discussions of
specific features.
@yujuhong

yujuhong commented Jul 1, 2016

Copy link
Copy Markdown
Contributor Author

Updated the boillerplate to the new style. Reapplying the lgtm.

@yujuhong yujuhong added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jul 1, 2016
@k8s-bot

k8s-bot commented Jul 1, 2016

Copy link
Copy Markdown

GCE e2e build/test passed for commit 08dc661.

@k8s-github-robot

Copy link
Copy Markdown

Automatic merge from submit-queue

@k8s-github-robot
k8s-github-robot merged commit fb19362 into kubernetes:master Jul 1, 2016
@erictune erictune mentioned this pull request Jul 11, 2016
12 tasks
k8s-github-robot pushed a commit that referenced this pull request Jul 12, 2016
Automatic merge from submit-queue

Proposal: client/server container runtime

Ref #25899  #13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node

// Linux contains configurations specific to Linux hosts.
Linux *LinuxPodSandboxConfig
}

@runcom runcom Jul 15, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there any particular issue in having an User property in PodSandboxConfig above? OCI would want to specify an user in the config.json as part of running a container with a specified user. Having the CRI proto to support that would let OCI containers to run with a particular user. @mrunalp @yujuhong @vishh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the securityContext of a container can have a runAsUser, we need something in this interface to be able to handle that. However, I think it should be solely part of a container's config, not pod sandbox.

Want to file a followup issue or make a PR to add this and discuss there instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree that adding this at the container level makes sense. PodSandbox could be left upto the runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 I'll make a PR to discuss that then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BTW, @euank sorry for the confusion, I did mean ContainerConfig not PodSandboxConfig

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 for adding user to container config.

// Mounts specifies mounts for the container
Mounts []Mount
// Labels are key value pairs that may be used to scope and select individual resources.
Labels Labels

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From where do these labels come?
What if the container runtime needs to know the origin of this container in k8s API terms, such as k8s namespace, k8s pod name, and user container name in the pod --- how could the runtime know those?

@euank euank Jul 19, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This interface abstracts those details away. Those labels realistically do contain such information, but it's an internal contract for the kubelet to use for itself only, not something the runtime is supposed to interpret in any way.

Right now those come mostly from here iirc and are used for things like calculating restart count and checkpointing data.

The interface explicitly does not express more to the runtime than it needs to know.

That being said, a sufficiently smart runtime could lookup a container it manages in the kubelet's pods endpoint based on its container ID I expect.
Realistically though, k8s namespaces and pod names and so on are all higher level details that the runtime should not have to care about.

k8s-github-robot pushed a commit that referenced this pull request Jul 22, 2016
Automatic merge from submit-queue

CRI: add LinuxUser to LinuxContainerConfig

Following discussion in #25899 (comment)

The Container Runtime Interface should provide runtimes with User information to run the container process as (OCI being one of them).
This patch introduces a new field `user` into `LinuxContainerConfig` structure. The `user` field introduces also a new type structure `LinuxUser` which consists of `uid`, `gid` and `additional_gids`. 

The `LinuxUser` struct has been embedded into `LinuxContainerConfig` to leave space for future implementations which are not Linux-related (e.g. Windows may have a different representation of _Users_).

If you feel naming can be better we can probably move `LinuxUser` to `UnixUser` also. 

/cc @mrunalp @vishh @euank @yujuhong 

Signed-off-by: Antonio Murdaca <[email protected]>
@yujuhong
yujuhong deleted the ncri branch September 21, 2016 00:15
xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
…er-proposal

Automatic merge from submit-queue

Proposal: client/server container runtime

Ref kubernetes#25899  kubernetes#13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
mhan8796 pushed a commit to mhan8796/kubernetes that referenced this pull request Jun 26, 2026
Automatic merge from submit-queue

Add a new container runtime interface

This PR includes a proposal and a Go file to re-define the container runtime interface.
This is based on the original doc: https://docs.google.com/document/d/1ietD5eavK0aTuMQTw6-21r67UU73_vqYSUIPFdA0J5Q/

The umbrella issues is kubernetes#22964

/cc @kubernetes/sig-node
mhan8796 pushed a commit to mhan8796/kubernetes that referenced this pull request Jun 26, 2026
…er-proposal

Automatic merge from submit-queue

Proposal: client/server container runtime

Ref kubernetes#25899  kubernetes#13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
mhan8796 pushed a commit to mhan8796/kubernetes that referenced this pull request Jun 26, 2026
Automatic merge from submit-queue

CRI: add LinuxUser to LinuxContainerConfig

Following discussion in kubernetes#25899 (comment)

The Container Runtime Interface should provide runtimes with User information to run the container process as (OCI being one of them).
This patch introduces a new field `user` into `LinuxContainerConfig` structure. The `user` field introduces also a new type structure `LinuxUser` which consists of `uid`, `gid` and `additional_gids`. 

The `LinuxUser` struct has been embedded into `LinuxContainerConfig` to leave space for future implementations which are not Linux-related (e.g. Windows may have a different representation of _Users_).

If you feel naming can be better we can probably move `LinuxUser` to `UnixUser` also. 

/cc @mrunalp @vishh @euank @yujuhong 

Signed-off-by: Antonio Murdaca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.