2017-08-24 17:09:52 +08:00
|
|
|
---
|
2019-11-07 02:11:52 +08:00
|
|
|
- name: Preinstall | propagate resolvconf to k8s components
|
2016-08-29 22:39:55 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2016-11-30 21:06:11 +08:00
|
|
|
- Preinstall | reload kubelet
|
2017-02-01 12:31:57 +08:00
|
|
|
- Preinstall | kube-controller configured
|
2018-01-31 05:26:07 +08:00
|
|
|
- Preinstall | kube-apiserver configured
|
2019-10-17 09:58:39 +08:00
|
|
|
- Preinstall | restart kube-controller-manager docker
|
|
|
|
- Preinstall | restart kube-controller-manager crio/containerd
|
|
|
|
- Preinstall | restart kube-apiserver docker
|
|
|
|
- Preinstall | restart kube-apiserver crio/containerd
|
2019-12-05 23:24:32 +08:00
|
|
|
when: not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
|
2016-08-29 22:39:55 +08:00
|
|
|
|
2017-01-05 18:35:16 +08:00
|
|
|
- name: Preinstall | update resolvconf for Container Linux by CoreOS
|
2016-11-23 22:49:10 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2016-12-07 23:57:05 +08:00
|
|
|
- Preinstall | apply resolvconf cloud-init
|
|
|
|
- Preinstall | reload kubelet
|
2019-12-05 23:24:32 +08:00
|
|
|
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
|
2016-09-27 17:54:12 +08:00
|
|
|
|
2016-12-07 23:57:05 +08:00
|
|
|
- name: Preinstall | apply resolvconf cloud-init
|
2016-11-23 22:49:10 +08:00
|
|
|
command: /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
|
2019-12-05 23:24:32 +08:00
|
|
|
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
|
2016-11-23 22:49:10 +08:00
|
|
|
|
2016-12-07 23:57:05 +08:00
|
|
|
- name: Preinstall | reload kubelet
|
2016-09-27 17:54:12 +08:00
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
state: restarted
|
2017-02-01 12:31:57 +08:00
|
|
|
notify:
|
|
|
|
- Preinstall | kube-controller configured
|
2018-01-31 05:26:07 +08:00
|
|
|
- Preinstall | kube-apiserver configured
|
2019-10-17 09:58:39 +08:00
|
|
|
- Preinstall | restart kube-controller-manager docker
|
|
|
|
- Preinstall | restart kube-controller-manager crio/containerd
|
|
|
|
- Preinstall | restart kube-apiserver docker
|
|
|
|
- Preinstall | restart kube-apiserver crio/containerd
|
2017-04-05 01:43:47 +08:00
|
|
|
when: not dns_early|bool
|
2017-02-01 12:31:57 +08:00
|
|
|
|
2018-01-31 05:26:07 +08:00
|
|
|
# FIXME(mattymo): Also restart for kubeadm mode
|
|
|
|
- name: Preinstall | kube-apiserver configured
|
|
|
|
stat: path="{{ kube_manifest_dir }}/kube-apiserver.manifest"
|
|
|
|
register: kube_apiserver_set
|
|
|
|
when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
|
|
|
|
|
|
|
# FIXME(mattymo): Also restart for kubeadm mode
|
2017-02-01 12:31:57 +08:00
|
|
|
- name: Preinstall | kube-controller configured
|
|
|
|
stat: path="{{ kube_manifest_dir }}/kube-controller-manager.manifest"
|
|
|
|
register: kube_controller_set
|
|
|
|
when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
|
|
|
|
2019-10-17 09:58:39 +08:00
|
|
|
- name: Preinstall | restart kube-controller-manager docker
|
2018-01-31 05:26:07 +08:00
|
|
|
shell: "docker ps -f name=k8s_POD_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
|
2019-10-17 09:58:39 +08:00
|
|
|
when:
|
|
|
|
- container_manager == "docker"
|
|
|
|
- inventory_hostname in groups['kube-master']
|
|
|
|
- dns_mode != 'none'
|
|
|
|
- resolvconf_mode == 'host_resolvconf'
|
|
|
|
- kube_controller_set.stat.exists
|
2018-01-31 05:26:07 +08:00
|
|
|
|
2019-10-17 09:58:39 +08:00
|
|
|
- name: Preinstall | restart kube-controller-manager crio/containerd
|
|
|
|
shell: crictl pods --name kube-controller-manager* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
|
|
|
|
when:
|
|
|
|
- container_manager in ['crio', 'containerd']
|
|
|
|
- inventory_hostname in groups['kube-master']
|
|
|
|
- dns_mode != 'none'
|
|
|
|
- resolvconf_mode == 'host_resolvconf'
|
|
|
|
- kube_controller_set.stat.exists
|
|
|
|
|
|
|
|
- name: Preinstall | restart kube-apiserver docker
|
2018-01-31 05:26:07 +08:00
|
|
|
shell: "docker ps -f name=k8s_POD_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
|
2019-10-17 09:58:39 +08:00
|
|
|
when:
|
|
|
|
- container_manager == "docker"
|
|
|
|
- inventory_hostname in groups['kube-master']
|
|
|
|
- dns_mode != 'none'
|
|
|
|
- resolvconf_mode == 'host_resolvconf'
|
|
|
|
|
|
|
|
- name: Preinstall | restart kube-apiserver crio/containerd
|
|
|
|
shell: crictl pods --name kube-apiserver* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
|
|
|
|
when:
|
|
|
|
- container_manager in ['crio', 'containerd']
|
|
|
|
- inventory_hostname in groups['kube-master']
|
|
|
|
- dns_mode != 'none'
|
|
|
|
- resolvconf_mode == 'host_resolvconf'
|
2019-11-06 19:33:52 +08:00
|
|
|
|
|
|
|
- name: Preinstall | Restart systemd-resolved
|
|
|
|
service:
|
|
|
|
name: systemd-resolved
|
|
|
|
state: restarted
|