2021-01-19 17:41:00 +08:00
|
|
|
- hosts: kube_master
|
2019-10-01 22:32:51 +08:00
|
|
|
tasks:
|
2021-01-19 17:41:00 +08:00
|
|
|
- name: stopping kube_master services
|
2019-10-01 22:32:51 +08:00
|
|
|
service: name={{ item }} state=stopped enabled=no
|
|
|
|
with_items:
|
|
|
|
- kube-apiserver
|
|
|
|
- kube-controller-manager
|
|
|
|
- kube-scheduler
|
|
|
|
|
|
|
|
- hosts: etcd
|
|
|
|
tasks:
|
|
|
|
- name: stopping etcd cluster
|
|
|
|
service: name=etcd state=stopped enabled=no
|
|
|
|
|
2021-01-19 17:41:00 +08:00
|
|
|
- hosts: ex_lb
|
2019-10-01 22:32:51 +08:00
|
|
|
tasks:
|
|
|
|
- name: stopping external loadbalance
|
|
|
|
service: name={{ item }} state=stopped enabled=no
|
|
|
|
with_items:
|
|
|
|
- haproxy
|
|
|
|
- keepalived
|
|
|
|
|
|
|
|
- hosts:
|
2021-01-19 17:41:00 +08:00
|
|
|
- kube_master
|
|
|
|
- kube_node
|
2019-10-01 22:32:51 +08:00
|
|
|
tasks:
|
2021-01-19 17:41:00 +08:00
|
|
|
- name: stopping haproxy on kube_node
|
2019-10-01 22:32:51 +08:00
|
|
|
service: name=haproxy state=stopped enabled=no
|
|
|
|
when:
|
2021-01-19 17:41:00 +08:00
|
|
|
- "inventory_hostname not in groups['kube_master']"
|
|
|
|
- "groups['kube_master']|length > 1"
|
2019-10-01 22:32:51 +08:00
|
|
|
|
2021-01-19 17:41:00 +08:00
|
|
|
- name: stopping kube_node services
|
2019-10-01 22:32:51 +08:00
|
|
|
service: name={{ item }} state=stopped enabled=no
|
|
|
|
with_items:
|
|
|
|
- kubelet
|
|
|
|
- kube-proxy
|
|
|
|
|
|
|
|
- name: stopping docker
|
|
|
|
service: name=docker state=stopped enabled=no
|
|
|
|
when: "CONTAINER_RUNTIME == 'docker'"
|
|
|
|
|
|
|
|
- name: stopping containerd
|
|
|
|
service: name=containerd state=stopped enabled=no
|
|
|
|
when: "CONTAINER_RUNTIME == 'containerd'"
|