Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

pod resources are not honoured in pod config file #925

Closed
devimc opened this issue Jan 15, 2018 · 2 comments · Fixed by #926
Closed

pod resources are not honoured in pod config file #925

devimc opened this issue Jan 15, 2018 · 2 comments · Fixed by #926
Assignees

Comments

@devimc
Copy link

devimc commented Jan 15, 2018

Description of problem

using constraints, pod vCPus and Memory are always 0 in kubernetes

run a container with kubernetes and take a look to the pod config file

kubectl --namespace=sandbox create -f ~/debian.yaml
cat /var/lib/virtcontainers/pods/$ID/config.json
... "VMConfig":{"VCPUs":0,"Memory":0}

debian.yaml

apiVersion: v1
kind: Pod
metadata:
  name: test
spec:
  containers:
  - name: test1
    image: debian
    resources:
      limits:
        cpu: "4"
    args: [ nproc ]
    tty: true
  - name: test2
    image: debian
    args: [ echo, "bye world!" ]
  - name: test3
    image: debian
    resources:
      limits:
        cpu: "3"
    args:
    - bash
    stdin: true
    tty: true

do the same, but using docker

docker run -dti --cpus=5 debian bash
cat /var/lib/virtcontainers/pods/$ID/config.json
... "VMConfig":{"VCPUs":5,"Memory":0}

Expected result

resources should not be 0 in the pod configuration

@devimc devimc self-assigned this Jan 15, 2018
devimc pushed a commit to devimc/runtime that referenced this issue Jan 15, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue Jan 15, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
@jodh-intel
Copy link
Contributor

I'm seeing the values showing as zero under docker too:

$ sudo jq -S '.VMConfig?' /var/lib/virtcontainers/pods/a4312f7ffab2cb385442eaa44903d0307a5a4a413868bf416d5e20d82fbdb543/config.json                               
{                                                                                                                                                                                             
  "Memory": 0,
  "VCPUs": 0
}

@devimc
Copy link
Author

devimc commented Jan 16, 2018

@jodh-intel ohh you're right, I forgot to mention that you have to use constrains

docker run -dti --cpus=5 debian bash

devimc pushed a commit to devimc/runtime that referenced this issue Jan 16, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue Jan 16, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue Jan 16, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/runtime that referenced this issue Jan 16, 2018
VM config resources must be honoured in order to create
the pod config with the right number of vCPUs and Memory,
whithout this patch vCPU and Memory will be always 0.

fixes clearcontainers#925

Signed-off-by: Julio Montes <[email protected]>
mcastelino pushed a commit to mcastelino/runtime that referenced this issue Dec 6, 2018
…ug-vfio-devices

virtcontainers: fix sandbox store struct VFIODevice bug
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants