Skip to content

Commit

Permalink
更新增加node步骤和文档
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao1983 committed Mar 8, 2018
1 parent 117448d commit 4246064
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
4 changes: 3 additions & 1 deletion 20.addnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
- prepare
- kubectl
- docker
- calico
- kube-node
# 根据hosts中配置,以下两种网络只会安装一种
- { role: calico, when: "CLUSTER_NETWORK == 'calico'" }
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }

- hosts: deploy
tasks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

- 常用插件部署 [kubedns](docs/guide/kubedns.md) [dashboard](docs/guide/dashboard.md) [heapster](docs/guide/heapster.md) [ingress](docs/guide/ingress.md) [efk](docs/guide/efk.md) [harbor](docs/guide/harbor.md)
- K8S 特性实验 [HPA](docs/guide/hpa.md) [NetworkPolicy](docs/guide/networkpolicy.md)
- 集群运维指南
- 集群运维指南 [AddNode](docs/guide/op/AddNode.md)
- 应用部署实践

请根据这份 [目录](docs/guide/index.md) 阅读你所感兴趣的内容,尚在更新中...
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

- 集群状态检查
- 集群扩容
- node 节点扩容
- [node 节点扩容](op/AddNode.md)
- master 节点扩容
- etcd 集群扩容
- 清理集群
Expand Down
44 changes: 44 additions & 0 deletions docs/guide/op/AddNode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## 增加 kube-node 节点

新增`kube-node`节点大致流程为:
- 1. 节点预处理 prepare
- 2. 安装 kubectl (可选)
- 3. 安装 docker
- 4. 安装 kubelet 和 kube-proxy
- 5. 准备网络插件 calico 或 flannel
- 6. 批准新节点 kubectl certificate approve

### 操作步骤

按照本项目说明,首先确保deploy节点能够ssh免密码登陆新增节点,然后在**deploy**节点执行两步:

- 1. 修改ansible hosts 文件,在 [new-node] 组编辑需要新增的节点,例如:

``` bash
...
# 预留组,后续添加node节点使用
[new-node]
192.168.1.6 NODE_ID=node6 NODE_IP="192.168.1.6"
...
```
- 2. 执行安装脚本

``` bash
$ cd /etc/ansible && ansible-playbook 20.addnode.yml
```

### 验证

``` bash
# 验证新节点状态
$ kubectl get node

# 验证新节点的网络插件calico 或flannel 的Pod 状态
$ kubectl get pod -n kube-system

# 验证新建负载能否调度到新节点,略
```

### 后续

上述步骤验证成功,确认新节点工作正常后,为了方便后续再次添加节点,在ansible hosts文件中,把 [new-node] 组下的节点全部复制到 [kube-node] 组下,并清空 [new-node] 组的节点。

0 comments on commit 4246064

Please sign in to comment.