-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_install.yml
94 lines (83 loc) · 1.55 KB
/
01_install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
- name: 0.系统初始化
gather_facts: false
hosts:
- k8s
- etcd
roles:
- common
tags: common
- name: 1.自签证书
gather_facts: false
hosts: localhost
roles:
- tls
tags: tls
- name: 2.部署containerd
gather_facts: false
hosts: k8s
roles:
- containerd
tags: containerd
- name: 3.部署ETCD集群
gather_facts: false
hosts: etcd
roles:
- etcd
tags: etcd
- name: 4.部署K8S Master
gather_facts: false
hosts: master
roles:
- master
tags: master
- name: 5. 部署Nginx负载均衡并高可用
gather_facts: false
hosts: lb
roles:
- ha
tags: ha
- name: 6.部署K8S Node
gather_facts: false
hosts: k8s
roles:
- node
tags: node
- name: 7.更新label
gather_facts: false
hosts:
- master
tasks:
- name: 打label标签
shell: >
kubectl label nodes {{ hostvars[item].node_name }} model={{ hostvars[item].node_label }} --overwrite
with_items: ["{{ groups.master }}", "{{ groups.node }}"]
- name: 打role标签
shell: >
kubectl label node {{ node_name }} kubernetes.io/role=master --overwrite
- name: 8.导入离线镜像
gather_facts: false
hosts: k8s
roles:
- images
tags: images
- name: 9.安装helm
gather_facts: false
hosts: helm
roles:
- docker
- helm
tags: helm
- name: 10.安装nfs_server
gather_facts: false
hosts: nfs_server
roles:
- nfs
tags: nfs
- name: 11.部署插件
gather_facts: false
hosts: master
roles:
- addons
run_once: true
tags: addons