| {%- from "kubernetes/map.jinja" import common with context -%} |
| {%- from "kubernetes/map.jinja" import master with context -%} |
| {%- from "kubernetes/map.jinja" import version %} |
| |
| {%- if master.get('network', {}).get('opencontrail', {}).get('enabled', false) %} |
| {%- if master.get('network', {}).get('opencontrail', {}).get('version', 3.0) >= 4.0 %} |
| {%- if master.get('enabled', false) %} |
| {# in case of OC4 there should not be CNI used #} |
| {%- set add_networking_plugin_conf = False %} |
| {%- endif %} |
| {%- else %} |
| {# in case of OC3 CNI should be everywhere #} |
| {%- set add_networking_plugin_conf = True %} |
| {%- endif %} |
| {%- else %} |
| {# In case of calico or any compute node - CNI should be everywhere #} |
| {%- set add_networking_plugin_conf = True %} |
| {%- endif %} |
| |
| # test_args has to be kept at the end, so they'll overwrite any prior configuration |
| DAEMON_ARGS="\ |
| --kubeconfig=/etc/kubernetes/kubelet.kubeconfig \ |
| --pod-manifest-path=/etc/kubernetes/manifests \ |
| --address={{ master.kubelet.address }} \ |
| --allow-privileged={{ master.kubelet.allow_privileged }} \ |
| --cluster_dns={{ common.addons.dns.server }} \ |
| --cluster_domain={{ common.addons.dns.domain|replace('_', '-') }} \ |
| {%- if common.get('cloudprovider', {}).get('enabled') and common.get('cloudprovider', {}).get('provider') == 'openstack' %} |
| --hostname-override={{ master.host.name }}.{{ common.cluster_domain }} \ |
| {%- else %} |
| --hostname-override={{ master.host.name }} \ |
| {%- endif %} |
| --v={{ master.get('verbosity', 2) }} \ |
| --node-labels=node-role.kubernetes.io/master=true \ |
| {%- if common.hyperkube.pause_image is defined %} |
| --pod-infra-container-image={{ common.hyperkube.pause_image }} \ |
| {%- endif %} |
| {%- if add_networking_plugin_conf %} |
| --network-plugin=cni \ |
| --cni-bin-dir={{ master.apiserver.get('cni_bin_dir', '/opt/cni/bin') }} \ |
| {%- endif %} |
| {%- if salt['pkg.version_cmp'](version,'1.8') >= 0 %} |
| --fail-swap-on={{ master.kubelet.fail_on_swap }} \ |
| {%- if common.addons.get('virtlet', {}).get('enabled') %} |
| --feature-gates=MountPropagation=true \ |
| {%- endif %} |
| {%- endif %} |
| {%- if master.get('unschedulable', 'false') %} |
| --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \ |
| {%- endif %} |
| {%- if common.get('cloudprovider', {}).get('enabled') %} |
| --cloud-provider=external \ |
| {%- endif %} |
| {%- if common.get('containerd', {}).get('enabled') %} |
| --container-runtime={{ master.get('container-runtime', 'remote') }} \ |
| --container-runtime-endpoint={{ master.get('container-runtime-endpoint', 'unix:///run/containerd/containerd.sock') }} \ |
| {%- endif %} |
| {%- for key, value in master.get('kubelet', {}).get('daemon_opts', {}).items() %} |
| --{{ key }}={{ value }} \ |
| {%- endfor %} |
| " |