blob: 6e42d36983c8956de145951e948bd3d5ec5a921f [file] [log] [blame]
Sergii Golovatiuk707f7d82017-08-07 15:49:23 +02001{%- from "kubernetes/map.jinja" import common with context -%}
2{%- from "kubernetes/map.jinja" import pool with context -%}
vrovachev3b141982017-10-06 16:52:40 +04003{%- from "kubernetes/map.jinja" import version %}
marcoacdae7e2015-12-02 15:35:37 +01004
Victor Ryzhenkin2e48de32018-08-10 18:29:55 +04005{%- if pillar.kubernetes.get('master', {}).get('network', {}).get('opencontrail', {}).get('enabled', false) %}
6{%- if pillar.kubernetes.get('master', {}).get('network', {}).get('opencontrail', {}).get('version', 3.0) >= 4.0 %}
7{%- if pillar.kubernetes.get('master', {}).get('enabled', false) %}
8{# in case of OC4 there should not be CNI used #}
9{%- set add_networking_plugin_conf = False %}
10{%- endif %}
11{%- else %}
12{# in case of OC3 CNI should be everywhere #}
13{%- set add_networking_plugin_conf = True %}
14{%- endif %}
15{%- else %}
16{# In case of calico or any compute node - CNI should be everywhere #}
17{%- set add_networking_plugin_conf = True %}
18{%- endif %}
19
marcoacdae7e2015-12-02 15:35:37 +010020# test_args has to be kept at the end, so they'll overwrite any prior configuration
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010021DAEMON_ARGS="\
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010022--kubeconfig=/etc/kubernetes/kubelet.kubeconfig \
Tomáš Kukrála5acf182017-03-23 13:05:25 +010023--pod-manifest-path=/etc/kubernetes/manifests \
Matthew Mosesohn276d6b22017-09-11 14:36:45 +030024--address={{ pool.kubelet.address }} \
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010025--allow-privileged={{ pool.kubelet.allow_privileged }} \
Sergey Kolekonovaa6c3932018-12-18 16:16:52 +040026--node-ip={{ pool.kubelet.address }} \
Sergii Golovatiuk707f7d82017-08-07 15:49:23 +020027--cluster_dns={{ common.addons.dns.server }} \
Matthew Mosesohn8c4ca8d2017-08-21 15:59:34 +030028--cluster_domain={{ common.addons.dns.domain|replace('_', '-') }} \
Sergey Kolekonovc9867d02018-11-29 19:41:00 +040029{%- if common.get('cloudprovider', {}).get('enabled') and common.get('cloudprovider', {}).get('provider') == 'openstack' %}
30--hostname-override={{ pool.host.name }}.{{ common.cluster_domain }} \
31{%- else %}
Tomáš Kukrál6a179552017-08-25 17:30:07 +020032--hostname-override={{ pool.host.name }} \
Sergey Kolekonovc9867d02018-11-29 19:41:00 +040033{%- endif %}
Tomáš Kukrálf78baa62017-04-20 16:18:16 +020034--v={{ pool.get('verbosity', 2) }} \
Andrey Shestakov0ec68f02018-05-21 17:19:45 +030035{%- if common.hyperkube.pause_image is defined %}
36--pod-infra-container-image={{ common.hyperkube.pause_image }} \
37{%- endif %}
Victor Ryzhenkin7f510f52018-04-28 18:54:47 +040038{%- if salt['pkg.version_cmp'](version,'1.8') >= 0 %}
Victor Ryzhenkinf0cdc3d2017-12-05 05:45:34 +040039--fail-swap-on={{ pool.kubelet.fail_on_swap }} \
Victor Ryzhenkin23b58b62018-02-14 19:38:46 +040040{%- if common.addons.get('virtlet', {}).get('enabled') %}
41--feature-gates=MountPropagation=true \
42{%- endif %}
Victor Ryzhenkinf0cdc3d2017-12-05 05:45:34 +040043{%- endif %}
Victor Ryzhenkin51348902017-12-21 19:52:25 +040044{%- if pillar.kubernetes.master is defined %}
45--node-labels=node-role.kubernetes.io/master=true \
Matthew Mosesohn7d0c3bb2017-09-11 14:20:17 +030046{%- if pillar.kubernetes.get('master', {}).get('unschedulable', 'false') %}
47--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
Tomáš Kukrál1f93c562017-09-11 17:02:19 +020048{%- endif -%}
Matthew Mosesohn7d0c3bb2017-09-11 14:20:17 +030049{%- else %}
Matthew Mosesohn3ef51c42017-05-19 12:49:24 +030050--node-labels=node-role.kubernetes.io/node=true \
Andrey Shestakov1856ae42018-07-24 13:19:58 +030051--node-labels=extraRuntime=virtlet \
Matthew Mosesohn7d0c3bb2017-09-11 14:20:17 +030052{%- endif %}
Victor Ryzhenkin2e48de32018-08-10 18:29:55 +040053{%- if add_networking_plugin_conf %}
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010054--network-plugin=cni \
vrovacheve9b238c2017-12-12 21:22:24 +040055--cni-bin-dir={{ pool.apiserver.get('cni_bin_dir', '/opt/cni/bin') }} \
Victor Ryzhenkin2e48de32018-08-10 18:29:55 +040056{%- endif %}
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010057--file-check-frequency={{ pool.kubelet.frequency }} \
Matthew Mosesohn19903512017-08-31 19:38:19 +030058{%- if common.get('cloudprovider', {}).get('enabled') %}
Sergey Kolekonovc9867d02018-11-29 19:41:00 +040059--cloud-provider=external \
Tomáš Kukrál10b15672017-09-05 10:08:46 +020060{%- if common.get('cloudprovider', {}).get('provider') == 'openstack' %}
Sergey Kolekonovc9867d02018-11-29 19:41:00 +040061--cloud-config=/etc/kubernetes/cloud-config \
Matthew Mosesohn19903512017-08-31 19:38:19 +030062{%- endif %}
63{%- endif %}
Sergii Golovatiuk707f7d82017-08-07 15:49:23 +020064{%- if common.addons.get('virtlet', {}).get('enabled') %}
Tomáš Kukrál45e7fc02017-08-10 15:32:07 +020065--container-runtime={{ pool.get('container-runtime', 'remote') }} \
Victor Ryzhenkin7f510f52018-04-28 18:54:47 +040066{%- if salt['pkg.version_cmp'](version,'1.7') < 0 %}
Tomáš Kukrál45e7fc02017-08-10 15:32:07 +020067--container-runtime-endpoint={{ pool.get('container-runtime-endpoint', '/var/run/criproxy.sock') }} \
68--image-service-endpoint={{ pool.get('image-service-endpoint', '/var/run/criproxy.sock') }} \
vrovachev3b141982017-10-06 16:52:40 +040069{%- else %}
70--container-runtime-endpoint={{ pool.get('container-runtime-endpoint', 'unix:///var/run/criproxy.sock') }} \
71--image-service-endpoint={{ pool.get('image-service-endpoint', 'unix:///var/run/criproxy.sock') }} \
72{%- endif %}
Tomáš Kukrál45e7fc02017-08-10 15:32:07 +020073--enable-controller-attach-detach={{ pool.get('enable-controller-attach-detach', 'false') }} \
Sergii Golovatiuk707f7d82017-08-07 15:49:23 +020074{%- endif %}
Andrey Shestakov9915ab82018-09-24 17:06:10 +030075{%- if common.get('containerd', {}).get('enabled') and not common.addons.get('virtlet', {}).get('enabled') %}
76--container-runtime={{ pool.get('container-runtime', 'remote') }} \
77--container-runtime-endpoint={{ pool.get('image-service-endpoint', 'unix:///run/containerd/containerd.sock') }} \
78{%- endif %}
Benjamin Drung8af2fa92018-02-15 00:08:00 +010079{%- for key, value in pool.get('kubelet', {}).get('daemon_opts', {}).items() %}
Yuriy Taraday36f43402017-08-29 16:13:41 +040080--{{ key }}={{ value }} \
Sergii Golovatiuk707f7d82017-08-07 15:49:23 +020081{%- endfor %}
Tomáš Kukrál5d33ce92017-03-21 15:15:14 +010082"