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.

30 lines
929 B

  1. #!/bin/bash
  2. {{ docker_bin_dir }}/docker run \
  3. --net=host \
  4. --pid=host \
  5. --privileged \
  6. --name=kubelet \
  7. --restart=on-failure:5 \
  8. --memory={{ kubelet_memory_limit|regex_replace('Mi', 'M') }} \
  9. --cpu-shares={{ kubelet_cpu_limit|regex_replace('m', '') }} \
  10. -v /dev:/dev:rw \
  11. -v /etc/cni:/etc/cni:ro \
  12. -v /opt/cni:/opt/cni:ro \
  13. -v /etc/ssl:/etc/ssl:ro \
  14. -v /etc/resolv.conf:/etc/resolv.conf \
  15. {% for dir in ssl_ca_dirs -%}
  16. -v {{ dir }}:{{ dir }}:ro \
  17. {% endfor -%}
  18. {% if kubelet_load_modules -%}
  19. -v /lib/modules:/lib/modules:ro \
  20. {% endif -%}
  21. -v /sys:/sys:ro \
  22. -v {{ docker_daemon_graph }}:/var/lib/docker:rw \
  23. -v /var/log:/var/log:rw \
  24. -v /var/lib/kubelet:/var/lib/kubelet:shared \
  25. -v /var/lib/cni:/var/lib/cni:shared \
  26. -v /var/run:/var/run:rw \
  27. -v {{kube_config_dir}}:{{kube_config_dir}}:ro \
  28. {{ hyperkube_image_repo }}:{{ hyperkube_image_tag}} \
  29. ./hyperkube kubelet \
  30. "$@"