Skip to content

Commit

Permalink
update setup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Oct 12, 2018
1 parent 53ccd81 commit e6edece
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 49 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

项目基于`Ubuntu 16.04/CentOS 7`,需要了解基础`kubernetes` `docker` `linux` `ansible`等知识。

请阅读[项目TodoList](docs/mixes/TodoList.md)[项目分支说明](docs/branch.md),欢迎提[Issues](https://github.com/gjmzj/kubeasz/issues)[PRs](docs/mixes/HowToContribute.md)参与维护项目。
请阅读[项目TodoList](docs/mixes/TodoList.md)[项目分支说明](docs/mixes/branch.md),欢迎提[Issues](https://github.com/gjmzj/kubeasz/issues)[PRs](docs/mixes/HowToContribute.md)参与维护项目。

|组件|更新|支持|
|:-|:-|:-|
Expand All @@ -20,22 +20,22 @@

## 快速指南

单机快速体验k8s集群的测试、开发环境--[AllinOne部署](docs/quickStart.md)
单机快速体验k8s集群的测试、开发环境--[AllinOne部署](docs/setup/quickStart.md)

## 安装步骤

<table border="0">
<tr>
<td><a href="docs/00-集群规划和基础参数设定.md">00-规划集群和安装概览</a></td>
<td><a href="docs/02-安装etcd集群.md">02-安装etcd集群</a></td>
<td><a href="docs/04-安装kube-master节点.md">04-安装master节点</a></td>
<td><a href="docs/06-安装网络组件.md">06-安装集群网络</a></td>
<td><a href="docs/setup/00-planning_and_overall_intro.md">00-规划集群和安装概览</a></td>
<td><a href="docs/setup/02-install_etcd.md">02-安装etcd集群</a></td>
<td><a href="docs/setup/04-install_kube_master.md">04-安装master节点</a></td>
<td><a href="docs/setup/06-install_network_plugin.md">06-安装集群网络</a></td>
</tr>
<tr>
<td><a href="docs/01-创建CA证书和环境配置.md">01-创建证书和安装准备</a></td>
<td><a href="docs/03-安装docker服务.md">03-安装docker服务</a></td>
<td><a href="docs/05-安装kube-node节点.md">05-安装node节点</a></td>
<td><a href="docs/07-安装集群插件.md">07-安装集群插件</a></td>
<td><a href="docs/setup/01-CA_and_prerequisite.md">01-创建证书和安装准备</a></td>
<td><a href="docs/setup/03-install_docker.md">03-安装docker服务</a></td>
<td><a href="docs/setup/05-install_kube_node.md">05-安装node节点</a></td>
<td><a href="docs/setup/07-install_cluster_addon.md">07-安装集群插件</a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/chrony.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ server {{ groups.deploy[0] }} iburst
## `kubeasz` 集成安装

- 修改 ansible hosts 文件,在 `deploy` 节点配置 `NTP_ENABLED=yes` (默认: no)
- [可选] 修改 roles/chrony/var/main.yml 中的变量定义,关于文件 roles/chrony/var/main.yml 的由来请看[这里](../config_guide.md)
- [可选] 修改 roles/chrony/var/main.yml 中的变量定义,关于文件 roles/chrony/var/main.yml 的由来请看[这里](../setup/config_guide.md)

对于新集群或者新节点,`chrony` 的安装配置已经集成到 `90.setup.yml` `01.prepare.yml` `20.addnode.yml` `21.addmaster.yml` 等脚本中;对于已运行中的集群请执行如下命令进行安装:

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/efk.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ es0 es1 es2

#### 使用动态 PV安装 EFK

- 首先根据[集群存储](../08-cluster-storage.md)创建nfs-client-provisioner
- 首先根据[集群存储](../setup/08-cluster-storage.md)创建nfs-client-provisioner
- 然后按实际需求修改 `es-dynamic-pv/es-statefulset.yaml` 文件中 volumeClaimTemplates 设置的 storage: 4Gi 大小

``` bash
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- helm
为了简化部署,通过helm来安装Jenkins,可参考文档:[helm](helm.md)
- 持久化存储
这里使用**NFS**演示,参考文档:[cluster-storage](../08-cluster-storage.md)
这里使用**NFS**演示,参考文档:[cluster-storage](../setup/08-cluster-storage.md)
如果k8s集群是部署在公有云,也可使用厂商的NAS等存储方案,项目中已集成支持阿里云NAS,其他的方案参考相关厂商文档

- Ingress Controller(nginx-ingress/traefik)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/op/change_k8s_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## 替换流程

kubeasz使用标准cni方式安装k8s集群的网络插件;cni负载创建容器网卡和IP分配(IPAM),不同的网络插件(calico,flannel等)创建容器网卡和IP分配方式不一样,所以在替换网络插件时候需要现有pod全部删除,然后自动按照新网络插件的方式重建pod网络;请参考[k8s网络插件章节](../06-安装网络组件.md)
kubeasz使用标准cni方式安装k8s集群的网络插件;cni负载创建容器网卡和IP分配(IPAM),不同的网络插件(calico,flannel等)创建容器网卡和IP分配方式不一样,所以在替换网络插件时候需要现有pod全部删除,然后自动按照新网络插件的方式重建pod网络;请参考[k8s网络插件章节](../setup/06-install_network_plugin.md)

### 替换操作

Expand All @@ -27,5 +27,5 @@ g.删除所有运行pod,然后等待自动重建

## 验证新网络插件

参照[calico](../06.calico.md) [flannel](../06.flannel.md) [kube-router](../06.kube-router.md)
参照[calico](../setup/calico.md) [cilium](../setup/cilium.md) [flannel](../setup/flannel.md) [kube-router](../setup/kube-router.md)

4 changes: 2 additions & 2 deletions docs/release-notes/kubeasz-0.2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ CHANGELOG:
- 集成其他插件(可选)使用离线docker镜像安装
- 增加切换集群网络插件的脚本
- 文档更新:
- [快速指南](https://github.com/gjmzj/kubeasz/blob/master/docs/quickStart.md)
- [安装规划](https://github.com/gjmzj/kubeasz/blob/master/docs/00-%E9%9B%86%E7%BE%A4%E8%A7%84%E5%88%92%E5%92%8C%E5%9F%BA%E7%A1%80%E5%8F%82%E6%95%B0%E8%AE%BE%E5%AE%9A.md)
- [快速指南](https://github.com/gjmzj/kubeasz/blob/master/docs/setup/quickStart.md)
- [安装规划](https://github.com/gjmzj/kubeasz/blob/master/docs/setup/00-planning_and_overall_intro.md)
- [切换网络](https://github.com/gjmzj/kubeasz/blob/master/docs/op/clean_k8s_network.md)
- 其他:
- Bug fix: 清理集群时可能出现`Device or resource busy: '/var/run/docker/netns/xxxxxxx'`的错误,可手动umount后重新清理集群
Expand Down
4 changes: 2 additions & 2 deletions docs/release-notes/kubeasz-0.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ CHANGELOG:
- 功能更新:
- **增加集群备份与恢复** 功能与[说明](https://github.com/gjmzj/kubeasz/blob/master/docs/op/cluster_restore.md)
- **增加cilium网络插件** ,文档待更新
- **增加cluster-storage角色**[文档说明](https://github.com/gjmzj/kubeasz/blob/master/docs/08-cluster-storage.md)
- **增加cluster-storage角色**[文档说明](https://github.com/gjmzj/kubeasz/blob/master/docs/setup/08-cluster-storage.md)
- 增加阿里云NAS存储支持
- 增加集群个性化[配置说明](https://github.com/gjmzj/kubeasz/blob/master/docs/config_guide.md)与生成脚本`tools/init_vars.yml`
- 增加集群个性化[配置说明](https://github.com/gjmzj/kubeasz/blob/master/docs/setup/config_guide.md)与生成脚本`tools/init_vars.yml`
- 支持deploy节点与ansible执行节点分离,为一份代码创建多个集群准备
- 其他:
- 更新 jenkins and plugins (#258)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 00-集群规划和基础参数设定.md
## 00-集群规划和基础参数设定

多节点高可用集群部署步骤与[AllinOne部署](quickStart.md)基本一致,增加LB 负载均衡部署步骤。

Expand Down Expand Up @@ -139,4 +139,4 @@ ansible-playbook 07.cluster-addon.yml
+ [可选]对集群所有节点进行操作系统层面的安全加固 `ansible-playbook roles/os-harden/os-harden.yml`,详情请参考[os-harden项目](https://github.com/dev-sec/ansible-os-hardening)
[前一篇](quickStart.md) -- [后一篇](01-创建CA证书和环境配置.md)
[后一篇](01-CA_and_prerequisite.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 01-创建证书和环境配置.md
# 01-创建证书和环境配置

本步骤[01.prepare.yml](../01.prepare.yml)主要完成:

Expand Down Expand Up @@ -326,5 +326,4 @@ ip a # 检查 master的 VIP地址是否存在
1. 尝试关闭 keepalived主节点上的 haproxy进程,然后在keepalived 备节点上查看 master的 VIP地址是否能够漂移过来,并依次检查上一步中的验证项。
1. 尝试直接关闭 keepalived 主节点系统,检查各验证项。


[前一篇](00-集群规划和基础参数设定.md) -- [后一篇](02-安装etcd集群.md)
[后一篇](02-install_etcd.md)
7 changes: 3 additions & 4 deletions docs/02-安装etcd集群.md → docs/setup/02-install_etcd.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 02-安装etcd集群.md
## 02-安装etcd集群

kuberntes 系统使用 etcd 存储所有数据,是最重要的组件之一,注意 etcd集群只能有奇数个节点(1,3,5...),本文档使用3个节点做集群。

Expand Down Expand Up @@ -83,7 +83,7 @@ LimitNOFILE=65536
WantedBy=multi-user.target
```
+ 完整参数列表请使用 `etcd --help` 查询
+ 注意etcd 即需要服务器证书也需要客户端证书,这里为方便使用一个peer 证书代替两个证书,更多证书相关请阅读 [01-创建CA证书和环境配置.md](01-创建CA证书和环境配置.md)
+ 注意etcd 即需要服务器证书也需要客户端证书,这里为方便使用一个peer 证书代替两个证书,更多证书相关请阅读 [01-创建CA证书和环境配置](01-CA_and_prerequisite.md)
+ 注意{{ }} 中的参数与ansible hosts文件中设置对应
+ `--initial-cluster-state` 值为 `new` 时,`--name` 的参数值必须位于 `--initial-cluster` 列表中;

Expand Down Expand Up @@ -119,5 +119,4 @@ https://192.168.1.3:2379 is healthy: successfully committed proposal: took = 3.2
```
三台 etcd 的输出均为 healthy 时表示集群服务正常。


[前一篇](01-创建CA证书和环境配置.md) -- [后一篇](03-安装docker服务.md)
[后一篇](03-install_docker.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 03-安装docker服务.md
## 03-安装docker服务

``` bash
roles/docker/
Expand Down Expand Up @@ -152,4 +152,4 @@ iptables-save|grep FORWARD
-A FORWARD -j ACCEPT
```

[前一篇](02-安装etcd集群.md) -- [后一篇](04-安装kube-master节点.md)
[后一篇](04-install_kube_master.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 04-安装kube-master节点.md
## 04-安装kube-master节点

部署master节点主要包含三个组件`apiserver` `scheduler` `controller-manager`,其中:

Expand Down Expand Up @@ -229,4 +229,4 @@ etcd-2 Healthy {"health": "true"}
etcd-1 Healthy {"health": "true"}
```

[前一篇](03-安装docker服务.md) -- [后一篇](05-安装kube-node节点.md)
[后一篇](05-install_kube_node.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 05-安装kube-node节点.md
## 05-安装kube-node节点

`kube-node` 是集群中承载应用的节点,前置条件需要先部署好`kube-master`节点(因为需要操作`用户角色绑定``批准kubelet TLS 证书请求`等),它需要部署如下组件:

Expand Down Expand Up @@ -135,4 +135,4 @@ NAME STATUS ROLES AGE VERSION
```


[前一篇](04-安装kube-master节点.md) -- [后一篇](06-安装网络组件.md)
[后一篇](06-install_network_plugin.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 06-安装网络组件.md
## 06-安装网络组件

首先回顾下K8S网络设计原则,在配置集群网络插件或者实践K8S 应用/服务部署请时刻想到这些原则:

Expand Down Expand Up @@ -29,14 +29,14 @@ Kubernetes Pod的网络是这样创建的:

### 安装讲解

- [安装calico](06.calico.md)
- [安装cilium](06.cilium.md)
- [安装flannel](06.flannel.md)
- [安装kube-router](06.kube-router.md)
- [安装calico](network-plugin/calico.md)
- [安装cilium](network-plugin/cilium.md)
- [安装flannel](network-plugin/flannel.md)
- [安装kube-router](network-plugin/kube-router.md)

### 参考
- [kubernetes.io networking docs](https://kubernetes.io/docs/concepts/cluster-administration/networking/)
- [feiskyer-kubernetes指南网络章节](https://github.com/feiskyer/kubernetes-handbook/blob/master/zh/network/network.md)


[前一篇](05-安装kube-node节点.md) -- [后一篇](07-安装集群插件.md)
[后一篇](07-install_cluster_addon.md)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 安装集群主要插件
# 07-安装集群主要插件

目前挑选一些常用、必要的插件自动集成到安装脚本之中:
- [自动脚本](../roles/cluster-addon/tasks/main.yml)
Expand All @@ -11,10 +11,6 @@
- 2.注册变量pod_info,pod_info用来判断现有集群是否已经运行各种插件
- 3.根据pod_info和`配置开关`逐个进行/跳过插件安装

## 下一步

[集群存储](08-cluster-storage.md)



[前一篇](06-安装网络组件.md) --
[后一篇](08-cluster-storage.md)
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/config_guide.md → docs/setup/config_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## ansible hosts

项目在[快速指南](quickStart.md)或者[集群规划与安装概览](00-集群规划和基础参数设定.md)已经介绍过,主要包括集群节点定义和集群范围的主要参数配置;目前提供三种集群部署模板。
项目在[快速指南](quickStart.md)或者[集群规划与安装概览](00-planning_and_overall_installing.md)已经介绍过,主要包括集群节点定义和集群范围的主要参数配置;目前提供三种集群部署模板。

- 尽量保持配置简单灵活
- 尽量保持配置项稳定
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion roles/calico/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NODE_WITH_MULTIPLE_NETWORKS: "true"
TMP_ENDPOINTS: "{% for h in groups['etcd'] %}https://{{ h }}:2379,{% endfor %}"
ETCD_ENDPOINTS: "{{ TMP_ENDPOINTS.rstrip(',') }}"

# 设置 CALICO_IPV4POOL_IPIP=“off”,可以提高网络性能,条件限制详见 docs/06.calico.md
# 设置 CALICO_IPV4POOL_IPIP=“off”,可以提高网络性能,条件限制详见 docs/setup/calico.md
CALICO_IPV4POOL_IPIP: "always"

# 设置 Felix 日志级别
Expand Down
2 changes: 1 addition & 1 deletion tools/init_vars.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [可选]初始化集群设置脚本,使用请参考docs/op/config_guide.md
# [可选]初始化集群设置脚本,使用请参考docs/setup/config_guide.md
# 如果创建集群时需要修改项目roles中默认配置,请执行本脚本后,编辑roles/xxx/vars/main.yml修改

- hosts: deploy
Expand Down

0 comments on commit e6edece

Please sign in to comment.