etcd: deploy container engine if needed (#7532)
If the etcd cluster is separate and the etcd_deployment_type is "host", there is no need for a container engine on the etcd nodes Do not rely on a 'default(true)' filter, but define a proper default in kubespray-defaults depending on etcd deployment method and if internal or external etcd is usedpull/8076/head
parent
6c004efd5f
commit
e4c8c7188e
|
@ -32,7 +32,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: kubespray-defaults }
|
- { role: kubespray-defaults }
|
||||||
- { role: kubernetes/preinstall, tags: preinstall }
|
- { role: kubernetes/preinstall, tags: preinstall }
|
||||||
- { role: "container-engine", tags: "container-engine", when: deploy_container_engine|default(true) }
|
- { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
|
||||||
- { role: download, tags: download, when: "not skip_downloads" }
|
- { role: download, tags: download, when: "not skip_downloads" }
|
||||||
|
|
||||||
- hosts: etcd
|
- hosts: etcd
|
||||||
|
|
|
@ -244,6 +244,9 @@ kubelet_shutdown_grace_period: 60s
|
||||||
# to give normal pods time to be gracefully evacuated
|
# to give normal pods time to be gracefully evacuated
|
||||||
kubelet_shutdown_grace_period_critical_pods: 20s
|
kubelet_shutdown_grace_period_critical_pods: 20s
|
||||||
|
|
||||||
|
# Whether to deploy the container engine
|
||||||
|
deploy_container_engine: inventory_hostname in groups['k8s_cluster'] or etcd_deployment_type != 'host'
|
||||||
|
|
||||||
# Container for runtime
|
# Container for runtime
|
||||||
container_manager: docker
|
container_manager: docker
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
when:
|
when:
|
||||||
- crictl.stat.exists
|
- crictl.stat.exists
|
||||||
- container_manager in ["crio", "containerd"]
|
- container_manager in ["crio", "containerd"]
|
||||||
- deploy_container_engine|default(true)
|
- deploy_container_engine
|
||||||
|
|
||||||
- name: reset | stop and disable crio service
|
- name: reset | stop and disable crio service
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: kubespray-defaults }
|
- { role: kubespray-defaults }
|
||||||
- { role: kubernetes/preinstall, tags: preinstall }
|
- { role: kubernetes/preinstall, tags: preinstall }
|
||||||
- { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
|
- { role: container-engine, tags: "container-engine", when: deploy_container_engine }
|
||||||
- { role: download, tags: download, when: "not skip_downloads" }
|
- { role: download, tags: download, when: "not skip_downloads" }
|
||||||
- { role: etcd, tags: etcd, etcd_cluster_setup: false, when: "not etcd_kubeadm_enabled|default(false)" }
|
- { role: etcd, tags: etcd, etcd_cluster_setup: false, when: "not etcd_kubeadm_enabled|default(false)" }
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
serial: "{{ serial | default('20%') }}"
|
serial: "{{ serial | default('20%') }}"
|
||||||
roles:
|
roles:
|
||||||
- { role: kubespray-defaults }
|
- { role: kubespray-defaults }
|
||||||
- { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
|
- { role: container-engine, tags: "container-engine", when: deploy_container_engine }
|
||||||
|
|
||||||
- hosts: etcd
|
- hosts: etcd
|
||||||
gather_facts: False
|
gather_facts: False
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: kubespray-defaults }
|
- { role: kubespray-defaults }
|
||||||
- { role: upgrade/pre-upgrade, tags: pre-upgrade }
|
- { role: upgrade/pre-upgrade, tags: pre-upgrade }
|
||||||
- { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
|
- { role: container-engine, tags: "container-engine", when: deploy_container_engine }
|
||||||
- { role: kubernetes/node, tags: node }
|
- { role: kubernetes/node, tags: node }
|
||||||
- { role: kubernetes/control-plane, tags: master, upgrade_cluster_setup: true }
|
- { role: kubernetes/control-plane, tags: master, upgrade_cluster_setup: true }
|
||||||
- { role: kubernetes/client, tags: client }
|
- { role: kubernetes/client, tags: client }
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: kubespray-defaults }
|
- { role: kubespray-defaults }
|
||||||
- { role: upgrade/pre-upgrade, tags: pre-upgrade }
|
- { role: upgrade/pre-upgrade, tags: pre-upgrade }
|
||||||
- { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
|
- { role: container-engine, tags: "container-engine", when: deploy_container_engine }
|
||||||
- { role: kubernetes/node, tags: node }
|
- { role: kubernetes/node, tags: node }
|
||||||
- { role: kubernetes/kubeadm, tags: kubeadm }
|
- { role: kubernetes/kubeadm, tags: kubeadm }
|
||||||
- { role: kubernetes/node-label, tags: node-label }
|
- { role: kubernetes/node-label, tags: node-label }
|
||||||
|
|
Loading…
Reference in New Issue