mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 16:28:45 -03:30
Move docker systemd unit creation to docker role
Creating the unit using default settings early on and then changing it during network_plugin section leads to too many docker restarts and duplicated code. Reversed Wants= dependence on docker.service so it does not restart docker when reloading systemd Consolidated all docker restart handlers.
This commit is contained in:
@@ -3,10 +3,10 @@ Description=Kubernetes Kubelet Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
|
||||
After=docker.service docker.socket calico-node.service
|
||||
Wants=docker.service docker.socket calico-node.service
|
||||
Wants=docker.socket calico-node.service
|
||||
{% else %}
|
||||
After=docker.service docker.socket
|
||||
Wants=docker.service docker.socket
|
||||
After=docker.service
|
||||
Wants=docker.socket
|
||||
{% endif %}
|
||||
|
||||
[Service]
|
||||
@@ -24,7 +24,7 @@ ExecStart={{ bin_dir }}/kubelet \
|
||||
$KUBELET_REGISTER_NODE \
|
||||
$KUBELET_NETWORK_PLUGIN \
|
||||
$KUBELET_CLOUDPROVIDER
|
||||
ExecStopPost=-/usr/bin/docker rm -f kubelet
|
||||
ExecStartPre=-/usr/bin/docker rm -f kubelet
|
||||
ExecReload=/usr/bin/docker restart kubelet
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
|
||||
Reference in New Issue
Block a user