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

Kubernetes Container Runtime Interface (CRI) doesn't support WindowsContainerConfig and WindowsContainerResources #56734

Closed
JiangtianLi opened this issue Dec 2, 2017 · 12 comments · Fixed by #59333
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Milestone

Comments

@JiangtianLi
Copy link
Contributor

JiangtianLi commented Dec 2, 2017

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

What happened:
Currently Container Runtime Interface (CRI) only supports LinuxContainerConfig and therefore LinuxContainerResources in ContainerConfig. Windows resource config is different from Linux's, although it shares some common properties. For example, docker's resource config for both platforms: https://github.com/moby/moby/blob/master/api/types/container/host_config.go#L308-L344. The resource controls for Windows containers is documented at: https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/resource-controls.

What you expected to happen:
Since LinuxContainerConfig is configuration specific to Linux containers, ideally there is WindowsContainerConfig for configuration specific to Windows containers, so that container runtime can take that config and pass to Windows containers. For example,

// WindowsContainerResources specifies Windows specific configuration for
// resources.
// https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/resource-controls
message WindowsContainerResources {
    // CPU count. Default: 0 (not specified).
    int64 cpus = 1;
    // CPU percent. Default: 0 (not specified).
    int64 cpu_percent = 2;
    // CPU shares (relative weight vs. other containers). Default: 0 (not specified).
    int64 cpu_shares = 3;
    // Memory limit in bytes. Default: 0 (not specified).
    int64 memory_limit_in_bytes = 4;
    // Maximum IOps for the container system drive. Default: 0 (not specified).
    int64 io_maximum_iops = 5;
    // Maximum IO in bytes per second for the container system drive. Default: 0 (not specified).
    int64 io_maximum_bandwidth = 6;
}

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): Windows
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 2, 2017
@JiangtianLi
Copy link
Contributor Author

/sig windows
/sig node

@k8s-ci-robot k8s-ci-robot added sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Dec 2, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 2, 2017
@JiangtianLi
Copy link
Contributor Author

@feiskyer
Copy link
Member

feiskyer commented Dec 2, 2017

+1 for the feature. Some questions

  • Does iops is required? CRI doesn't support setting iops yet.
  • How windows would handle pod resources? Kubelet set pod-level cgroups for Linux containers
  • Does all current LinuxContainerResources make sense for Windows containers? e.g. all fields below

// LinuxContainerResources specifies Linux specific configuration for
// resources.
// TODO: Consider using Resources from opencontainers/runtime-spec/specs-go
// directly.
message LinuxContainerResources {
// CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified).
int64 cpu_period = 1;
// CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified).
int64 cpu_quota = 2;
// CPU shares (relative weight vs. other containers). Default: 0 (not specified).
int64 cpu_shares = 3;
// Memory limit in bytes. Default: 0 (not specified).
int64 memory_limit_in_bytes = 4;
// OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified).
int64 oom_score_adj = 5;
// CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified).
string cpuset_cpus = 6;
// CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified).
string cpuset_mems = 7;
}

cc/ @brendanburns @dchen1107 @yujuhong @kubernetes/sig-node-feature-requests

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 2, 2017
@thecloudtaylor
Copy link

cc Windows container core (@jhowardmsft; @darrenstahlmsft; @jstarks; @PatrickLang)

  • Iops is optional (without specifying a value the container is unbounded in regards to IO)

  • Ideally I think a per pod spec and a per container spec would make since (possibly the pod is just a sum of the containers but pod + container settings would enable nice sharing scenarios). With the goals of being as similar to existing (Linux) behavior and also getting to a solid MVP, what do we think makes since?

  • With the ability to run Linux containers on Windows we would want it in the kublet :) but even for windows we have some of these values but not all. See https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/resource-controls for some more details.

@JiangtianLi
Copy link
Contributor Author

Going forward, I think we need Windows config in CRI to be container runtime agnostic. I am trying to find spec from OCI eventually, not from docker's config in https://github.com/moby/moby/blob/master/api/types/container/host_config.go. Is https://github.com/opencontainers/runtime-spec/blob/master/specs-go/config.go something we could refer to?

@feiskyer feiskyer self-assigned this Dec 12, 2017
@feiskyer feiskyer added this to the v1.10 milestone Dec 12, 2017
@jberkus
Copy link

jberkus commented Feb 3, 2018

a) Is this a bug or a feature?

b) if it's a feature, please add it to feature tracking.

c) also, please add a priority/ label

@feiskyer feiskyer added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 3, 2018
@feiskyer
Copy link
Member

feiskyer commented Feb 3, 2018

Feature issue is here: kubernetes/enhancements#547

@JiangtianLi
Copy link
Contributor Author

Changed this issue from bug to feature.

@jberkus
Copy link

jberkus commented Feb 3, 2018

Thanks!

k8s-github-robot pushed a commit that referenced this issue Feb 3, 2018
Automatic merge from submit-queue (batch tested with PRs 59097, 57076, 59295). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add windows config to Kubelet CRI

**What this PR does / why we need it**:

Currently Container Runtime Interface (CRI) only supports LinuxContainerConfig and therefore LinuxContainerResources in ContainerConfig. Windows resource config is different from Linux's, although it shares some common properties. 

This PR adds windows config to CRI. Add newly added WindowsContainerResources is original from OCI spec (see https://github.com/opencontainers/runtime-spec/blob/master/specs-go/config.go#L437).


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

First part of #56734. A further PR is needed to fill the values after we have agreement on the spec.

**Special notes for your reviewer**:

**Release note**:

```release-note
Add windows config to Kubelet CRI
```

/assign @yujuhong @brendandburns 
/cc @taylorb-microsoft @JiangtianLi @dchen1107
@jberkus
Copy link

jberkus commented Feb 21, 2018

Please add status/approved-for-milestone if this feature is staying in 1.10 Thanks!

@JiangtianLi
Copy link
Contributor Author

/status approved-for-milestone

@k8s-ci-robot
Copy link
Contributor

You must be a member of the kubernetes/kubernetes-milestone-maintainers github team to add status labels.

k8s-github-robot pushed a commit that referenced this issue Feb 28, 2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: setup WindowsContainerResources for windows containers

**What this PR does / why we need it**:

This PR setups WindowsContainerResources for windows containers. It implements proposal here: kubernetes/community#1510.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56734

**Special notes for your reviewer**:

**Release note**:

```release-note
WindowsContainerResources is set now for windows containers
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants