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.

44 lines
2.8 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. {% if ansible_service_mgr in ["sysvinit","upstart"] %}
  2. # Logging directory
  3. KUBE_LOGGING="--log-dir={{ kube_log_dir }} --logtostderr=true"
  4. {% else %}
  5. # logging to stderr means we get it in the systemd journal
  6. KUBE_LOGGING="--logtostderr=true"
  7. {% endif %}
  8. KUBE_LOG_LEVEL="--v={{ kube_log_level | default('2') }}"
  9. # The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
  10. KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}"
  11. # The port for the info server to serve on
  12. # KUBELET_PORT="--port=10250"
  13. # You may leave this blank to use the actual hostname
  14. KUBELET_HOSTNAME="--hostname-override={{ ansible_hostname }}"
  15. {% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %}
  16. KUBELET_REGISTER_NODE="--register-node=false"
  17. {% endif %}
  18. # location of the api-server
  19. {% if dns_setup|bool and skip_dnsmasq|bool %}
  20. KUBELET_ARGS="--cluster_dns={{ skydns_server }} --cluster_domain={{ dns_domain }} --kubeconfig={{ kube_config_dir}}/node-kubeconfig.yaml --require-kubeconfig --pod-manifest-path={{ kube_manifest_dir }} --resolv-conf={{ kube_resolv_conf }} --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
  21. {% elif dns_setup|bool %}
  22. KUBELET_ARGS="--cluster_dns={{ dns_server }} --cluster_domain={{ dns_domain }} --kubeconfig={{ kube_config_dir}}/node-kubeconfig.yaml --require-kubeconfig --pod-manifest-path={{ kube_manifest_dir }} --resolv-conf={{ kube_resolv_conf }} --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
  23. {% else %}
  24. KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --require-kubeconfig --pod-manifest-path={{ kube_manifest_dir }} --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
  25. {% endif %}
  26. {% if kube_network_plugin is defined and kube_network_plugin in ["calico", "weave", "canal"] %}
  27. KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
  28. {% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
  29. DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
  30. {% endif %}
  31. # Should this cluster be allowed to run privileged docker containers
  32. KUBE_ALLOW_PRIV="--allow-privileged=true"
  33. {% if cloud_provider is defined and cloud_provider == "openstack" %}
  34. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }} --cloud-config={{ kube_config_dir }}/cloud_config"
  35. {% elif cloud_provider is defined and cloud_provider == "aws" %}
  36. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }}"
  37. {% else %}
  38. KUBELET_CLOUDPROVIDER=""
  39. {% endif %}
  40. {% if ansible_service_mgr in ["sysvinit","upstart"] %}
  41. DAEMON_ARGS="$KUBE_LOGGING $KUBE_LOG_LEVEL $KUBE_ALLOW_PRIV $KUBELET_API_SERVER $KUBELET_ADDRESS \
  42. $KUBELET_HOSTNAME $KUBELET_REGISTER_NODE $KUBELET_ARGS $DOCKER_SOCKET $KUBELET_ARGS $KUBELET_NETWORK_PLUGIN \
  43. $KUBELET_CLOUDPROVIDER"
  44. {% endif %}