最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kind - how to enable cpu_rt_runtime in kubernetes - Stack Overflow

programmeradmin0浏览0评论

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

  1. staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto add int64 cpu_rt_runtime = 11 at the end of LinuxContainerResources ,then I rebuild api.pb.go
  2. pkg/kubelet/kuberuntime/kuberuntime_container_linux.go add resources.CpuRtRuntime = 5000 before return &resources in func (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

发布评论

评论列表(0)

  1. 暂无评论