2017-11-11 19:14:21 +08:00
|
|
|
[Unit]
|
|
|
|
Description=Kubernetes Kubelet
|
|
|
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
WorkingDirectory=/var/lib/kubelet
|
2020-09-27 19:21:50 +08:00
|
|
|
ExecStartPre=/bin/mount -o remount,rw '/sys/fs/cgroup'
|
2019-06-25 22:55:29 +08:00
|
|
|
{% if KUBE_RESERVED_ENABLED == "yes" or SYS_RESERVED_ENABLED == "yes" %}
|
2020-05-23 15:16:01 +08:00
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpu/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpuacct/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpuset/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/memory/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/pids/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/systemd/podruntime.slice
|
|
|
|
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpu/system.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpuacct/system.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/cpuset/system.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/memory/system.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/pids/system.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/systemd/system.slice
|
2020-09-27 19:21:50 +08:00
|
|
|
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/hugetlb/podruntime.slice
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/hugetlb/system.slice
|
2023-06-24 12:10:43 +08:00
|
|
|
|
|
|
|
ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/podruntime.slice
|
2020-09-27 19:21:50 +08:00
|
|
|
{% endif %}
|
2017-11-11 19:14:21 +08:00
|
|
|
ExecStart={{ bin_dir }}/kubelet \
|
2019-07-13 11:01:08 +08:00
|
|
|
--config=/var/lib/kubelet/config.yaml \
|
2023-06-23 00:10:53 +08:00
|
|
|
--container-runtime-endpoint=unix:///run/containerd/containerd.sock \
|
2023-01-15 21:41:45 +08:00
|
|
|
--hostname-override={{ K8S_NODENAME }} \
|
2018-09-11 20:46:46 +08:00
|
|
|
--kubeconfig=/etc/kubernetes/kubelet.kubeconfig \
|
2018-08-29 22:16:50 +08:00
|
|
|
--root-dir={{ KUBELET_ROOT_DIR }} \
|
2017-11-11 19:14:21 +08:00
|
|
|
--v=2
|
2019-07-19 13:47:10 +08:00
|
|
|
Restart=always
|
2017-11-11 19:14:21 +08:00
|
|
|
RestartSec=5
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|