Unable to access cgroup in kubernetes pod

1/30/2018

With docker run -it -v /sys/fs/cgroup:/sys/fs/cgroup, I am able to see the /sys/fs/cgroup/memory/system.slice/docker-.scope/memory.limit_in_byte.

But if I deploy a Pod with the same docker image via Kubernetes deployment and hostpath volume mount, same is not seen inside the container.

  volumeMounts:
  - name: cgroup
    mountPath: /hostfs/sys/fs/cgroup
volumes:
- name: cgroup
  hostPath:
    path : /sys/fs/cgroup

Anyone seen the same issue?

-- Joshua S N
docker
kubernetes

1 Answer

10/13/2019

Wonder if the pod has the right RBAC privileges. For starters, I think it should be a privileged container

-- pr-pal
Source: StackOverflow