Fix etcd install with docker and etcd_kubeadm_enabled (#5777)

- This solves issue #5721 & #5713 (dupes)
  - Provide a cleaner default usage pattern for the download role
    around etcd that supports 'host' and 'docker' properly
  - Extract the 'etcdctl' as a separate task install piece and reuse it where
    appropriate
  - Update the kubeadm-etcd task to reflect the above change
This commit is contained in:
Stephen Schmidt
2020-03-24 11:12:47 -04:00
committed by GitHub
parent bc2eeb0560
commit 0379a52f03
6 changed files with 31 additions and 15 deletions

View File

@@ -16,3 +16,12 @@
include_tasks: "{{ role_path }}/../../etcd/tasks/install_host.yml"
vars:
etcd_cluster_setup: true
when: etcd_deployment_type == "host"
- name: Ensure etcdctl binary is installed
include_tasks: "{{ role_path }}/../../etcd/tasks/install_etcdctl_docker.yml"
vars:
etcd_cluster_setup: true
etcd_retries: 4
when:
- etcd_deployment_type == "docker"

View File

@@ -260,6 +260,12 @@
msg: "kubeadm etcd mode requires experimental control plane"
when: etcd_kubeadm_enabled
- name: Stop if etcd deployment type is not host or docker
assert:
that: etcd_deployment_type in ['host', 'docker']
msg: "The etcd deployment type, 'etcd_deployment_type', must be host or docker"
run_once: true
- name: Stop if download_localhost is enabled but download_run_once is not
assert:
that: download_run_once

View File

@@ -185,7 +185,6 @@
kube_etcd_cacert_file: "etcd/ca.crt"
kube_etcd_cert_file: "apiserver-etcd-client.crt"
kube_etcd_key_file: "apiserver-etcd-client.key"
etcd_deployment_type: host
when:
- etcd_kubeadm_enabled