I want the defalut container(contained) in the k8s pod to use the parameter cpu-rt-runtime, so I modified the following part of the k8s code to test it
staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto
addint64 cpu_rt_runtime = 11
at the end ofLinuxContainerResources
,then I rebuild api.pb.gopkg/kubelet/kuberuntime/kuberuntime_container_linux.go
addresources.CpuRtRuntime = 5000
beforereturn &resources
infunc (m *kubeGenericRuntimeManager) calculateLinuxResources
then i create cluster using kind and build a debian pod with kubectl run -it --rm debian-shell --image=debian:latest --restart=Never -- bash
, all success, but after i entered conatiner i found that
cat /sys/fs/cgroup/cpu,cpuacct/cpu.rt_runtime_us
return 0
May I ask if my changes are correct?
i am using kernel v5.8(CONFIG_RT_GROUP_SCHED=y), Ubuntu20.04, k8s v1.32.3, kind v0.27.0 docker 28.0.2
i followed and command
docker run -it \
--cpu-rt-runtime=950000 \
--ulimit rtprio=99 \
--cap-add=sys_nice \
debian:jessie
works well in my system