Skip to content

Commit

Permalink
清理kube-master组定义
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao1983 committed Mar 2, 2018
1 parent c3af702 commit ed70790
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 25 deletions.
3 changes: 2 additions & 1 deletion 01.prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

# 集群节点的公共配置任务
- hosts:
- kube-cluster
- kube-master
- kube-node
- deploy
- etcd
- lb
Expand Down
3 changes: 2 additions & 1 deletion 03.kubectl.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- hosts:
- kube-cluster
- kube-master
- kube-node
- deploy
roles:
- kubectl
5 changes: 3 additions & 2 deletions 04.docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- hosts: kube-cluster
#gather_facts: True
- hosts:
- kube-master
- kube-node
roles:
- docker
4 changes: 3 additions & 1 deletion 07.calico.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- hosts: kube-cluster
- hosts:
- kube-master
- kube-node
roles:
- { role: calico, when: "CLUSTER_NETWORK == 'calico'" }
4 changes: 3 additions & 1 deletion 07.flannel.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- hosts: kube-cluster
- hosts:
- kube-master
- kube-node
roles:
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
14 changes: 10 additions & 4 deletions 90.setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

# 集群节点的公共配置任务
- hosts:
- kube-cluster
- kube-master
- kube-node
- deploy
- etcd
- lb
Expand All @@ -25,13 +26,16 @@

# kubectl 客户端配置
- hosts:
- kube-cluster
- kube-master
- kube-node
- deploy
roles:
- kubectl

# docker服务安装
- hosts: kube-cluster
- hosts:
- kube-master
- kube-node
roles:
- docker

Expand All @@ -46,7 +50,9 @@
- kube-node

# 集群网络插件部署,只能选择一种安装
- hosts: kube-cluster
- hosts:
- kube-master
- kube-node
roles:
- { role: calico, when: "CLUSTER_NETWORK == 'calico'" }
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
17 changes: 15 additions & 2 deletions 99.clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
- "/etc/kubernetes/"

- hosts:
- kube-cluster
- kube-master
- kube-node
- new-node
- deploy
tasks:
- name: stop docker service
shell: "systemctl stop docker"
Expand Down Expand Up @@ -116,3 +116,16 @@
- "/etc/keepalived"
ignore_errors: true

- hosts:
- kube-master
- kube-node
- new-node
- deploy
- etcd
- lb
task:
- name: 清理证书目录和文件
file: name={{ item }} state=absent
with_items:
- "{{ ca_dir }}"

4 changes: 0 additions & 4 deletions example/hosts.allinone.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
[kube-node]
192.168.1.1 NODE_ID=node1 NODE_IP="192.168.1.1"

[kube-cluster:children]
kube-node
kube-master

# 如果启用harbor,请配置后面harbor相关参数
[harbor]
#192.168.1.8 NODE_IP="192.168.1.8"
Expand Down
5 changes: 0 additions & 5 deletions example/hosts.m-masters.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@
[lb:vars]
LB_EP1="192.168.1.1:6443" # api-server 实际成员地址端口
LB_EP2="192.168.1.2:6443" # api-server 实际成员地址端口
MASTER_IP="192.168.1.10" # api-server 虚地址
MASTER_PORT="8443" # api-server 服务端口

[kube-node]
192.168.1.2 NODE_ID=node1 NODE_IP="192.168.1.2"
192.168.1.3 NODE_ID=node2 NODE_IP="192.168.1.3"
192.168.1.4 NODE_ID=node3 NODE_IP="192.168.1.4"

[kube-cluster:children]
kube-node
kube-master

# 如果启用harbor,请配置后面harbor相关参数
[harbor]
#192.168.1.8 NODE_IP="192.168.1.8"
Expand Down
4 changes: 0 additions & 4 deletions example/hosts.s-master.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
192.168.1.2 NODE_ID=node2 NODE_IP="192.168.1.2"
192.168.1.3 NODE_ID=node3 NODE_IP="192.168.1.3"

[kube-cluster:children]
kube-node
kube-master

# 如果启用harbor,请配置后面harbor相关参数
[harbor]
#192.168.1.8 NODE_IP="192.168.1.8"
Expand Down

0 comments on commit ed70790

Please sign in to comment.