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.3 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. {% if inventory_hostname in groups['kube-node'] %}
  10. KUBELET_API_SERVER="--api_servers={{ kube_apiserver_endpoint }}"
  11. {% endif %}
  12. # The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
  13. KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}"
  14. # The port for the info server to serve on
  15. # KUBELET_PORT="--port=10250"
  16. # You may leave this blank to use the actual hostname
  17. KUBELET_HOSTNAME="--hostname-override={{ inventory_hostname }}"
  18. {% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %}
  19. KUBELET_REGISTER_NODE="--register-node=false"
  20. {% endif %}
  21. # location of the api-server
  22. {% if dns_setup %}
  23. KUBELET_ARGS="--cluster_dns={{ dns_server }} --cluster_domain={{ dns_domain }} --kubeconfig={{ kube_config_dir}}/node-kubeconfig.yaml --config={{ kube_manifest_dir }} --resolv-conf={{ kube_resolv_conf }}"
  24. {% else %}
  25. KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --config={{ kube_manifest_dir }}"
  26. {% endif %}
  27. {% if kube_network_plugin is defined and kube_network_plugin in ["calico", "weave"] %}
  28. KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
  29. {% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
  30. DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
  31. {% endif %}
  32. # Should this cluster be allowed to run privileged docker containers
  33. KUBE_ALLOW_PRIV="--allow-privileged=true"
  34. {% if cloud_provider is defined and cloud_provider == "openstack" %}
  35. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }} --cloud-config={{ kube_config_dir }}/cloud_config"
  36. {% else %}
  37. {# TODO: gce and aws don't need the cloud provider to be set? #}
  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 %}