Merge pull request #271 from resouer/pod-level-qos
Support pod level qos in cri-o
This commit is contained in:
commit
b2fbd828e1
3 changed files with 9 additions and 1 deletions
|
@ -251,6 +251,11 @@ func (s *Server) createSandboxContainer(containerID string, containerName string
|
||||||
specgen.SetLinuxResourcesOOMScoreAdj(int(oomScoreAdj))
|
specgen.SetLinuxResourcesOOMScoreAdj(int(oomScoreAdj))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sb.cgroupParent != "" {
|
||||||
|
// NOTE: we only support cgroupfs for now, discussion happens in issue #270.
|
||||||
|
specgen.SetLinuxCgroupsPath(sb.cgroupParent + "/" + containerID)
|
||||||
|
}
|
||||||
|
|
||||||
capabilities := linux.GetSecurityContext().GetCapabilities()
|
capabilities := linux.GetSecurityContext().GetCapabilities()
|
||||||
if capabilities != nil {
|
if capabilities != nil {
|
||||||
addCaps := capabilities.GetAddCapabilities()
|
addCaps := capabilities.GetAddCapabilities()
|
||||||
|
|
|
@ -138,6 +138,7 @@ type sandbox struct {
|
||||||
netns *sandboxNetNs
|
netns *sandboxNetNs
|
||||||
metadata *pb.PodSandboxMetadata
|
metadata *pb.PodSandboxMetadata
|
||||||
shmPath string
|
shmPath string
|
||||||
|
cgroupParent string
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -245,7 +245,9 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
||||||
// setup cgroup settings
|
// setup cgroup settings
|
||||||
cgroupParent := req.GetConfig().GetLinux().GetCgroupParent()
|
cgroupParent := req.GetConfig().GetLinux().GetCgroupParent()
|
||||||
if cgroupParent != "" {
|
if cgroupParent != "" {
|
||||||
g.SetLinuxCgroupsPath(cgroupParent)
|
// NOTE: we only support cgroupfs for now, discussion happens in issue #270.
|
||||||
|
g.SetLinuxCgroupsPath(cgroupParent + "/" + containerID)
|
||||||
|
sb.cgroupParent = cgroupParent
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up namespaces
|
// set up namespaces
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue