Sergii Golovatiuk | 707f7d8 | 2017-08-07 15:49:23 +0200 | [diff] [blame] | 1 | {%- from "kubernetes/map.jinja" import common with context -%} |
| 2 | {%- from "kubernetes/map.jinja" import pool with context -%} |
vrovachev | 3b14198 | 2017-10-06 16:52:40 +0400 | [diff] [blame] | 3 | {%- from "kubernetes/map.jinja" import version %} |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 4 | |
Victor Ryzhenkin | 2e48de3 | 2018-08-10 18:29:55 +0400 | [diff] [blame] | 5 | {%- 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 | |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 20 | # test_args has to be kept at the end, so they'll overwrite any prior configuration |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 21 | DAEMON_ARGS="\ |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 22 | --kubeconfig=/etc/kubernetes/kubelet.kubeconfig \ |
Tomáš Kukrál | a5acf18 | 2017-03-23 13:05:25 +0100 | [diff] [blame] | 23 | --pod-manifest-path=/etc/kubernetes/manifests \ |
Matthew Mosesohn | 276d6b2 | 2017-09-11 14:36:45 +0300 | [diff] [blame] | 24 | --address={{ pool.kubelet.address }} \ |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 25 | --allow-privileged={{ pool.kubelet.allow_privileged }} \ |
Sergey Kolekonov | aa6c393 | 2018-12-18 16:16:52 +0400 | [diff] [blame] | 26 | --node-ip={{ pool.kubelet.address }} \ |
Sergii Golovatiuk | 707f7d8 | 2017-08-07 15:49:23 +0200 | [diff] [blame] | 27 | --cluster_dns={{ common.addons.dns.server }} \ |
Matthew Mosesohn | 8c4ca8d | 2017-08-21 15:59:34 +0300 | [diff] [blame] | 28 | --cluster_domain={{ common.addons.dns.domain|replace('_', '-') }} \ |
Sergey Kolekonov | c9867d0 | 2018-11-29 19:41:00 +0400 | [diff] [blame] | 29 | {%- 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ál | 6a17955 | 2017-08-25 17:30:07 +0200 | [diff] [blame] | 32 | --hostname-override={{ pool.host.name }} \ |
Sergey Kolekonov | c9867d0 | 2018-11-29 19:41:00 +0400 | [diff] [blame] | 33 | {%- endif %} |
Tomáš Kukrál | f78baa6 | 2017-04-20 16:18:16 +0200 | [diff] [blame] | 34 | --v={{ pool.get('verbosity', 2) }} \ |
Andrey Shestakov | 0ec68f0 | 2018-05-21 17:19:45 +0300 | [diff] [blame] | 35 | {%- if common.hyperkube.pause_image is defined %} |
| 36 | --pod-infra-container-image={{ common.hyperkube.pause_image }} \ |
| 37 | {%- endif %} |
Victor Ryzhenkin | 7f510f5 | 2018-04-28 18:54:47 +0400 | [diff] [blame] | 38 | {%- if salt['pkg.version_cmp'](version,'1.8') >= 0 %} |
Victor Ryzhenkin | f0cdc3d | 2017-12-05 05:45:34 +0400 | [diff] [blame] | 39 | --fail-swap-on={{ pool.kubelet.fail_on_swap }} \ |
Victor Ryzhenkin | 23b58b6 | 2018-02-14 19:38:46 +0400 | [diff] [blame] | 40 | {%- if common.addons.get('virtlet', {}).get('enabled') %} |
| 41 | --feature-gates=MountPropagation=true \ |
| 42 | {%- endif %} |
Victor Ryzhenkin | f0cdc3d | 2017-12-05 05:45:34 +0400 | [diff] [blame] | 43 | {%- endif %} |
Victor Ryzhenkin | 5134890 | 2017-12-21 19:52:25 +0400 | [diff] [blame] | 44 | {%- if pillar.kubernetes.master is defined %} |
| 45 | --node-labels=node-role.kubernetes.io/master=true \ |
Matthew Mosesohn | 7d0c3bb | 2017-09-11 14:20:17 +0300 | [diff] [blame] | 46 | {%- if pillar.kubernetes.get('master', {}).get('unschedulable', 'false') %} |
| 47 | --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \ |
Tomáš Kukrál | 1f93c56 | 2017-09-11 17:02:19 +0200 | [diff] [blame] | 48 | {%- endif -%} |
Matthew Mosesohn | 7d0c3bb | 2017-09-11 14:20:17 +0300 | [diff] [blame] | 49 | {%- else %} |
Matthew Mosesohn | 3ef51c4 | 2017-05-19 12:49:24 +0300 | [diff] [blame] | 50 | --node-labels=node-role.kubernetes.io/node=true \ |
Andrey Shestakov | 1856ae4 | 2018-07-24 13:19:58 +0300 | [diff] [blame] | 51 | --node-labels=extraRuntime=virtlet \ |
Matthew Mosesohn | 7d0c3bb | 2017-09-11 14:20:17 +0300 | [diff] [blame] | 52 | {%- endif %} |
Victor Ryzhenkin | 2e48de3 | 2018-08-10 18:29:55 +0400 | [diff] [blame] | 53 | {%- if add_networking_plugin_conf %} |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 54 | --network-plugin=cni \ |
vrovachev | e9b238c | 2017-12-12 21:22:24 +0400 | [diff] [blame] | 55 | --cni-bin-dir={{ pool.apiserver.get('cni_bin_dir', '/opt/cni/bin') }} \ |
Victor Ryzhenkin | 2e48de3 | 2018-08-10 18:29:55 +0400 | [diff] [blame] | 56 | {%- endif %} |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 57 | --file-check-frequency={{ pool.kubelet.frequency }} \ |
Matthew Mosesohn | 1990351 | 2017-08-31 19:38:19 +0300 | [diff] [blame] | 58 | {%- if common.get('cloudprovider', {}).get('enabled') %} |
Sergey Kolekonov | c9867d0 | 2018-11-29 19:41:00 +0400 | [diff] [blame] | 59 | --cloud-provider=external \ |
Tomáš Kukrál | 10b1567 | 2017-09-05 10:08:46 +0200 | [diff] [blame] | 60 | {%- if common.get('cloudprovider', {}).get('provider') == 'openstack' %} |
Sergey Kolekonov | c9867d0 | 2018-11-29 19:41:00 +0400 | [diff] [blame] | 61 | --cloud-config=/etc/kubernetes/cloud-config \ |
Matthew Mosesohn | 1990351 | 2017-08-31 19:38:19 +0300 | [diff] [blame] | 62 | {%- endif %} |
| 63 | {%- endif %} |
Sergii Golovatiuk | 707f7d8 | 2017-08-07 15:49:23 +0200 | [diff] [blame] | 64 | {%- if common.addons.get('virtlet', {}).get('enabled') %} |
Tomáš Kukrál | 45e7fc0 | 2017-08-10 15:32:07 +0200 | [diff] [blame] | 65 | --container-runtime={{ pool.get('container-runtime', 'remote') }} \ |
Victor Ryzhenkin | 7f510f5 | 2018-04-28 18:54:47 +0400 | [diff] [blame] | 66 | {%- if salt['pkg.version_cmp'](version,'1.7') < 0 %} |
Tomáš Kukrál | 45e7fc0 | 2017-08-10 15:32:07 +0200 | [diff] [blame] | 67 | --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') }} \ |
vrovachev | 3b14198 | 2017-10-06 16:52:40 +0400 | [diff] [blame] | 69 | {%- 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ál | 45e7fc0 | 2017-08-10 15:32:07 +0200 | [diff] [blame] | 73 | --enable-controller-attach-detach={{ pool.get('enable-controller-attach-detach', 'false') }} \ |
Sergii Golovatiuk | 707f7d8 | 2017-08-07 15:49:23 +0200 | [diff] [blame] | 74 | {%- endif %} |
Andrey Shestakov | 9915ab8 | 2018-09-24 17:06:10 +0300 | [diff] [blame] | 75 | {%- 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 Drung | 8af2fa9 | 2018-02-15 00:08:00 +0100 | [diff] [blame] | 79 | {%- for key, value in pool.get('kubelet', {}).get('daemon_opts', {}).items() %} |
Yuriy Taraday | 36f4340 | 2017-08-29 16:13:41 +0400 | [diff] [blame] | 80 | --{{ key }}={{ value }} \ |
Sergii Golovatiuk | 707f7d8 | 2017-08-07 15:49:23 +0200 | [diff] [blame] | 81 | {%- endfor %} |
Tomáš Kukrál | 5d33ce9 | 2017-03-21 15:15:14 +0100 | [diff] [blame] | 82 | " |