###
# kubernetes kubelet (node) config

# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
KUBELET_ADDRESS="--address=0.0.0.0"

# The port for the info server to serve on
# KUBELET_PORT="--port=10250"

# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname-override={{ inventory_hostname }}"

# location of the api-server
KUBELET_API_SERVER="--api-servers=https://{{ groups['masters'][0] }}:{{ kube_master_api_port }}"

{% set kubelet_options = [] -%}
{% if dns_setup -%}
{{ kubelet_options.append('--cluster-dns=' + dns_server)|default('', true) -}}
{{ kubelet_options.append('--cluster-domain=' + dns_domain)|default('', true) -}}
{% endif -%}
{% if networking == "opencontrail" -%}
{{ kubelet_options.append('--network-plugin=opencontrail')|default('', true) -}}
{% endif -%}

KUBELET_ARGS="--kubeconfig={{ kube_config_dir }}/kubelet.kubeconfig --config={{ kube_manifest_dir }} {{ kubelet_options|join(' ') }}"
