c12s-kubespray/roles/kubernetes/node/templates/kubelet-container.j2
Bogdan Dobrelya 13f5217d88 Controll delayed startup/restart for kubelet/etcd
In order to mitigate sporadic data races in etcd
(publish error: etcdserver: request timed out"):
- Add etcd_start_delay and kubelet_start_delay (defaults to a 5 sec.)
- Increase default start sleep times to foo_start_delay from a 1 sec.
- Add restart sleeping as well.
- Add missing start sleep commands as appropriate.

Closes: https://github.com/kubespray/kargo/issues/342

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2016-10-20 15:25:32 +02:00

16 lines
459 B
Django/Jinja

#!/bin/bash
sleep {{ kubelet_start_delay }}
/usr/bin/docker run --privileged --rm \
--net=host --pid=host --name=kubelet \
-v /etc/cni:/etc/cni:ro \
-v /opt/cni:/opt/cni:ro \
-v /etc/kubernetes:/etc/kubernetes \
-v /sys:/sys \
-v /dev:/dev \
-v /var/lib/docker:/var/lib/docker \
-v /var/run:/var/run \
-v /var/lib/kubelet:/var/lib/kubelet \
{{ hyperkube_image_repo }}:{{ hyperkube_image_tag}} \
nsenter --target=1 --mount --wd=. -- \
./hyperkube kubelet \
$@