2019-10-01 22:32:51 +08:00
|
|
|
- hosts: etcd
|
|
|
|
tasks:
|
|
|
|
- name: starting etcd cluster
|
|
|
|
service: name=etcd state=started enabled=yes
|
|
|
|
|
2021-04-01 19:18:59 +08:00
|
|
|
- hosts:
|
|
|
|
- kube_master
|
|
|
|
- kube_node
|
|
|
|
tasks:
|
|
|
|
- name: starting kube-lb
|
|
|
|
service: name=kube-lb state=started enabled=yes
|
|
|
|
|
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: starting kube_master services
|
2019-10-01 22:32:51 +08:00
|
|
|
service: name={{ item }} state=started enabled=yes
|
|
|
|
with_items:
|
|
|
|
- kube-apiserver
|
|
|
|
- kube-controller-manager
|
|
|
|
- kube-scheduler
|
|
|
|
|
|
|
|
- hosts:
|
2021-01-19 17:41:00 +08:00
|
|
|
- kube_master
|
|
|
|
- kube_node
|
2019-10-01 22:32:51 +08:00
|
|
|
tasks:
|
|
|
|
- name: starting docker
|
|
|
|
service: name=docker state=started enabled=yes
|
|
|
|
when: "CONTAINER_RUNTIME == 'docker'"
|
|
|
|
|
|
|
|
- name: starting containerd
|
|
|
|
service: name=containerd state=started enabled=yes
|
|
|
|
when: "CONTAINER_RUNTIME == 'containerd'"
|
|
|
|
|
2021-01-19 17:41:00 +08:00
|
|
|
- name: starting kube_node services
|
2019-10-01 22:32:51 +08:00
|
|
|
service: name={{ item }} state=started enabled=yes
|
|
|
|
with_items:
|
|
|
|
- kubelet
|
|
|
|
- kube-proxy
|
|
|
|
|
2021-01-19 17:41:00 +08:00
|
|
|
- hosts: ex_lb
|
2019-10-01 22:32:51 +08:00
|
|
|
tasks:
|
|
|
|
- name: starting external loadbalance
|
|
|
|
service: name={{ item }} state=started enabled=yes
|
|
|
|
with_items:
|
|
|
|
- haproxy
|
|
|
|
- keepalived
|