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.

51 lines
2.8 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. # logging to stderr means we get it in the systemd journal
  2. KUBE_LOGGING="--logtostderr=true"
  3. KUBE_LOG_LEVEL="--v={{ kube_log_level }}"
  4. # The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
  5. KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}"
  6. # The port for the info server to serve on
  7. # KUBELET_PORT="--port=10250"
  8. # You may leave this blank to use the actual hostname
  9. KUBELET_HOSTNAME="--hostname-override={{ ansible_hostname }}"
  10. {# Base kubelet args #}
  11. {% set kubelet_args_base %}--pod-manifest-path={{ kube_manifest_dir }} \
  12. --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }} \
  13. --kube-reserved cpu={{ kubelet_cpu_limit }},memory={{ kubelet_memory_limit|regex_replace('Mi', 'M') }} \
  14. --node-status-update-frequency={{ kubelet_status_update_frequency }}{% endset %}
  15. {# DNS settings for kubelet #}
  16. {% if dns_mode == 'kubedns' %}
  17. {% set kubelet_args_cluster_dns %}--cluster_dns={{ skydns_server }}{% endset %}
  18. {% elif dns_mode == 'dnsmasq_kubedns' %}
  19. {% set kubelet_args_cluster_dns %}--cluster_dns={{ dns_server }}{% endset %}
  20. {% else %}
  21. {% set kubelet_args_cluster_dns %}{% endset %}
  22. {% endif %}
  23. {% set kubelet_args_dns %}{{ kubelet_args_cluster_dns }} --cluster_domain={{ dns_domain }} --resolv-conf={{ kube_resolv_conf }}{% endset %}
  24. {# Location of the apiserver #}
  25. {% set kubelet_args_kubeconfig %}--kubeconfig={{ kube_config_dir}}/node-kubeconfig.yaml --require-kubeconfig{% endset %}
  26. {% if standalone_kubelet|bool %}
  27. {# We are on a master-only host. Make the master unschedulable in this case. #}
  28. {% set kubelet_args_kubeconfig %}{{ kubelet_args_kubeconfig }} --register-schedulable=false{% endset %}
  29. {% endif %}
  30. KUBELET_ARGS="{{ kubelet_args_base }} {{ kubelet_args_dns }} {{ kubelet_args_kubeconfig }}"
  31. {% if kube_network_plugin is defined and kube_network_plugin in ["calico", "weave", "canal"] %}
  32. KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
  33. {% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
  34. DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
  35. {% elif kube_network_plugin is defined and kube_network_plugin == "cloud" %}
  36. # Please note that --reconcile-cidr is deprecated and a no-op in Kubernetes 1.5 but still required in 1.4
  37. KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet --reconcile-cidr=true"
  38. {% endif %}
  39. # Should this cluster be allowed to run privileged docker containers
  40. KUBE_ALLOW_PRIV="--allow-privileged=true"
  41. {% if cloud_provider is defined and cloud_provider in ["openstack", "azure"] %}
  42. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }} --cloud-config={{ kube_config_dir }}/cloud_config"
  43. {% elif cloud_provider is defined and cloud_provider == "aws" %}
  44. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }}"
  45. {% else %}
  46. KUBELET_CLOUDPROVIDER=""
  47. {% endif %}