Add system-reserved in kubelet

dev1
gjmzj 2019-06-12 21:35:51 +08:00
parent d519f55056
commit 533aa7e9d0
2 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,7 @@ MAX_PODS: 110
# 配置为kube组件kubelet,kube-proxy,dockerd等预留的资源量
KUBE_RESERVED_ENABLED: "yes"
KUBE_RESERVED: "cpu=200m,memory=500Mi,ephemeral-storage=1Gi"
SYS_RESERVED: "cpu=200m,memory=500Mi,ephemeral-storage=1Gi"
# 配置kubelet的hard eviction条件
HARD_EVICTION: "memory.available<200Mi,nodefs.available<10%"
HARD_EVICTION: "memory.available<500Mi,nodefs.available<10%"

View File

@ -39,9 +39,11 @@ ExecStart={{ bin_dir }}/kubelet \
--cgroups-per-qos=true \
--cgroup-driver=cgroupfs \
{% if KUBE_RESERVED_ENABLED == "yes" %}
--enforce-node-allocatable=pods,kube-reserved \
--enforce-node-allocatable=pods,kube-reserved,system-reserved \
--kube-reserved={{ KUBE_RESERVED }} \
--kube-reserved-cgroup=/system.slice/kubelet.service \
--system-reserved={{ SYS_RESERVED }} \
--system-reserved-cgroup=/system.slice \
{% endif %}
--eviction-hard={{ HARD_EVICTION }} \
--v=2