You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.3 KiB

  1. [Unit]
  2. Description=Kubernetes Kubelet Server
  3. Documentation=https://github.com/GoogleCloudPlatform/kubernetes
  4. {% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
  5. After=calico-node.service
  6. Wants=network.target calico-node.service
  7. {% else %}
  8. Wants=network.target
  9. {% endif %}
  10. [Service]
  11. Restart=on-failure
  12. RestartSec=10s
  13. TimeoutStartSec=0
  14. LimitNOFILE=40000
  15. ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/run/kubelet.uuid
  16. ExecStartPre=-/bin/mkdir -p /var/lib/kubelet
  17. EnvironmentFile={{kube_config_dir}}/kubelet.env
  18. # stage1-fly mounts /proc /sys /dev so no need to duplicate the mounts
  19. ExecStart=/usr/bin/rkt run \
  20. --volume var-log,kind=host,source=/var/log \
  21. --volume dns,kind=host,source=/etc/resolv.conf \
  22. --volume etc-kubernetes,kind=host,source={{ kube_config_dir }},readOnly=false \
  23. --volume etc-ssl-certs,kind=host,source=/etc/ssl/certs,readOnly=true \
  24. --volume usr-share-certs,kind=host,source=/usr/share/ca-certificates,readOnly=true \
  25. --volume var-lib-docker,kind=host,source={{ docker_daemon_graph }},readOnly=false \
  26. --volume var-lib-kubelet,kind=host,source=/var/lib/kubelet,readOnly=false \
  27. --volume run,kind=host,source=/run,readOnly=false \
  28. --mount volume=var-log,target=/var/log \
  29. --mount volume=dns,target=/etc/resolv.conf \
  30. --mount volume=etc-kubernetes,target={{ kube_config_dir }} \
  31. --mount volume=etc-ssl-certs,target=/etc/ssl/certs \
  32. --mount volume=usr-share-certs,target=/usr/share/ca-certificates \
  33. --mount volume=var-lib-docker,target=/var/lib/docker \
  34. --mount volume=var-lib-kubelet,target=/var/lib/kubelet \
  35. --mount volume=run,target=/run \
  36. --stage1-from-dir=stage1-fly.aci \
  37. {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} \
  38. --uuid-file-save=/var/run/kubelet.uuid \
  39. --debug --exec=/kubelet -- \
  40. $KUBE_LOGTOSTDERR \
  41. $KUBE_LOG_LEVEL \
  42. $KUBELET_API_SERVER \
  43. $KUBELET_ADDRESS \
  44. $KUBELET_PORT \
  45. $KUBELET_HOSTNAME \
  46. $KUBE_ALLOW_PRIV \
  47. $KUBELET_ARGS \
  48. $DOCKER_SOCKET \
  49. $KUBELET_REGISTER_NODE \
  50. $KUBELET_NETWORK_PLUGIN
  51. ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet.uuid
  52. [Install]
  53. WantedBy=multi-user.target