У меня мало вопросов для kubelet-reserved-resoure. я не знаю, что моя конфигурация на самом деле работает или нет.
step1: я создаю cgroup dir с помощью следующей команды
for i in `ls -L /sys/fs/cgroup`; do mkdir -p /sys/fs/cgroup/$i/kube-reserved.slice; done
for i in `ls -L /sys/fs/cgroup`; do mkdir -p /sys/fs/cgroup/$i/system-reserved.slice; done
step2: добавьте аргументы kubelet, например:
--enforce-node-allocatable=pods,kube-reserved,system-reserved \
--kube-reserved=cpu=1,memory=1Gi \
--kube-reserved-cgroup=/kube-reserved.slice \
--system-reserved=cpu=1,memory=1Gi \
--system-reserved-cgroup=/system-reserved.slice \
--cgroup-root=/ --v=4
после запуска кублета. Я вижу, что узел Allocatable изменен, как я и ожидал.
Capacity:
cpu: 8
ephemeral-storage: 9480420Ki
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 16414252Ki
pods: 110
Allocatable:
cpu: 6
ephemeral-storage: 8737155058
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 14214700Ki
pods: 110
Журналы Kubelet для system-reserved.slice
:
root@k8s-node02:~# journalctl -xeu kubelet |grep -v ignoring |grep system-reserved.slice
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.712207 7117 factory.go:177] Factory "docker" was unable to handle container "/system-reserved.slice"
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.712214 7117 factory.go:166] Error trying to work out if we can handle /system-reserved.slice: /system-reserved.slice not handled by systemd handler
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.712218 7117 factory.go:177] Factory "systemd" was unable to handle container "/system-reserved.slice"
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.712225 7117 factory.go:177] Factory "containerd" was unable to handle container "/system-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.715222 7117 factory.go:177] Factory "docker" was unable to handle container "/system-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.715229 7117 factory.go:166] Error trying to work out if we can handle /system-reserved.slice: /system-reserved.slice not handled by systemd handler
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.715232 7117 factory.go:177] Factory "systemd" was unable to handle container "/system-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.715238 7117 factory.go:177] Factory "containerd" was unable to handle container "/system-reserved.slice"
Журналы Kubelet для kube-reserved.slice
:
root@k8s-node02:~# journalctl -xeu kubelet |grep -v ignoring |grep kube-reserved.slice
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.711765 7117 factory.go:177] Factory "docker" was unable to handle container "/kube-reserved.slice"
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.711772 7117 factory.go:166] Error trying to work out if we can handle /kube-reserved.slice: /kube-reserved.slice not handled by systemd handler
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.711776 7117 factory.go:177] Factory "systemd" was unable to handle container "/kube-reserved.slice"
Jan 20 11:23:46 k8s-node02 kubelet[7117]: I0120 11:23:46.711783 7117 factory.go:177] Factory "containerd" was unable to handle container "/kube-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.713871 7117 factory.go:177] Factory "docker" was unable to handle container "/kube-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.713877 7117 factory.go:166] Error trying to work out if we can handle /kube-reserved.slice: /kube-reserved.slice not handled by systemd handler
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.713880 7117 factory.go:177] Factory "systemd" was unable to handle container "/kube-reserved.slice"
Jan 20 11:24:46 k8s-node02 kubelet[7117]: I0120 11:24:46.713886 7117 factory.go:177] Factory "containerd" was unable to handle container "/kube-reserved.slice"
это нормально для установки ресурса-зарезервировано? или моя конфигурация неверна?