This commit is contained in:
huanqing.shao
2021-04-05 13:09:28 +08:00
parent 086cf27744
commit c0cdcc0de0
163 changed files with 631 additions and 293 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

View File

@ -98,14 +98,22 @@ meta:
</b-tab>
<b-tab title="使用 Kuboard 执行金丝雀发布">
在 Kuboard 执行金丝雀发布的过程,与使用 kubectl 的过程相同,此处特别说明的一点是,当使用 Kuboard 创建 `web-nginx-canary` Deployment时如何解决其Pod 的标签被 `web-nginx` 的Service包含的问题
在 Kuboard 执行金丝雀发布的过程,与使用 kubectl 的过程相同,此处特别说明的一点是,当使用 Kuboard 创建 `web-nginx-canary` Deployment时可以在原工作负载上点击 ***复制*** 按钮,如下图所示
![Kubernetes教程_在Kuboard中执行金丝雀发布](./canary.assets/image-20210404191658446.png)
在弹出对话框的 ***名称*** 字段中填写 `web-nginx-canary`,如下图所示:
![Kubernetes教程_在Kuboard中执行金丝雀发布](./canary.assets/image-20210404191758533.png)
如何解决其Pod 的标签被 `web-nginx` 的Service包含的问题
* 当填写部署的名称 `web-nginx-canary` 之后,将默认创建两个标签,且不可修改:`k8s.eip.work/layer:web` 和 `k8s.eip.work/name:web-nginx-canary`
* 此时,手工创建标签 `k8s.eip.work/name:web-nginx`,可以覆盖原默认创建的标签
* 完成创建后,`web-nginx-canary` 的 Pod 也包含标签 `k8s.eip.work/layer:web` 和 `k8s.eip.work/name:web-nginx`,可以被 `web-nginx` 的Service选中
* 通过 Kuboard 创建 `web-nginx-canary` 部署时,无需配置 Service 和 Ingress
![Kubernetes教程_在Kuboard中执行金丝雀发布](./canary.assets/image-20191013204426338.png)
![Kubernetes教程_在Kuboard中执行金丝雀发布](./canary.assets/image-20210404192020345.png)
</b-tab>
</b-tabs>

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 KiB

View File

@ -21,7 +21,9 @@ meta:
Kuboard 中,可以通过如下界面调整 `.spec.revisionHistoryLimit` 字段,如下所示:
![Kubernetes Deployment revisionHistoryLimit](./cleanup.assets/image-20200315164731927.png)
![Kubernetes Deployment revisionHistoryLimit](./cleanup.assets/image-20210404191001116.png)
![Kubernetes Deployment revisionHistoryLimit](./cleanup.assets/image-20210404191039298.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

View File

@ -139,13 +139,11 @@ pod-template-hash 标签是 Deployment 创建 ReplicaSet 时添加到 ReplicaSet
1. 进入 Kuboard 名称空间页面,点击页头上***创建工作负载*** 按钮;
1. 进入 Kuboard 名称空间页面,点击左侧菜单中***创建工作负载*** 按钮;
截图如下所示:
![Kuboard-创建Deployment](./create.assets/image-20210404181251603.png)
![Kubernetes-教程](./create.assets/image-20200315103827631.png)
2. 在工作负载创建页面填写表单如下:
并填写如下表单:
| 区域 | 字段名称 | 填写内容 | 字段说明 |
| ----------------- | -------- | ------------ | ------------------------------------------------------------ |
@ -153,27 +151,28 @@ pod-template-hash 标签是 Deployment 创建 ReplicaSet 时添加到 ReplicaSet
| | 服务分层 | 展现层 | Kuboard 特性的字段,用于表示该工作复杂显示在名称空间的哪一个分层 |
| | 服务名称 | web-nginx | |
| | 副本数量 | 3 | |
| 容器组-->工作容器 | 容器名称 | nginx | |
| | 镜像 | nginx:1.7.9 | |
| | Ports | TCP : 80 | 容器组暴露的端口 |
截图如下图所示:
![Kubernetes-教程](./create.assets/image-20200315103300026.png)
2. 切换到 ***容器信息*** Tab 页,如下图所示:
![Kuboard-创建Deployment-容器信息](./create.assets/image-20210404181616368.png)
并填写如下表单:
| 区域 | 字段名称 | 填写内容 | 字段说明 |
| ----------------------- | -------- | ------------ | ---------------- |
| 容器信息-->添加工作容器 | 容器名称 | nginx | |
| | 镜像 | nginx:1.7.9 | |
| | Ports | TCP : 80 | 容器组暴露的端口 |
3. 点击保存后,可以看到 Deployment 的更新界面,如下图所示:
Kuboard 在界面中显示了 ReplicaSets、Pods 的动态变化过程。
> 显示 ReplicaSets 的特性要求 Kuboard 版本不低于 v1.0.8
![Kubernetes-教程](./create.assets/image-20200315105410219.png)
![Kubernetes-教程](./create.assets/image-20200315110103544.png)
![Kuboard-创建Deployment-已创建](./create.assets/image-20210404181829648.png)
4. 对于每一个 PodKuboard 提供了如下几个功能可以便捷的与容器内应用进行交互:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

View File

@ -111,19 +111,19 @@ meta:
* 在 Deployment 详情页中点击 ***处理状态*** 的开关,可以暂停 Deployment 处理,修改后如下图所示:
* 在 Deployment 详情页中点击 ***暂停更新*** 的开关,可以暂停 Deployment 处理,修改后如下图所示:
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20200315161430483.png)
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20210404185743940.png)
* 点击 ***调整镜像标签*** 按钮,设置新版本为 `1.15.8`,如下图所示:
保存后,可以看到 Deployment 中已经将容器镜像版本修改为 `nginx:1.15.8`然而Deployment 控制器此时并未执行滚动更新的过程,因为 Deployment 的处理已经被暂停。
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20200315161646155.png)
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20210404185840034.png)
* 点击 ***处理状态*** 的开关,将其设定为 `已继续`Deployment 将立刻开始执行滚动更新,最终结果如下图所示:
* 点击 ***继续更新*** 的开关Deployment 将立刻开始执行滚动更新,如下图所示:
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20200315162152085.png)
![Kubernetes-教程-暂停Deployment](./pause.assets/image-20210404190223597.png)
@ -131,5 +131,4 @@ meta:
</b-tabs>
</b-card>
[返回 Deployment](./#deployment-概述)
[返回 Deployment](./#deployment-概述)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

View File

@ -230,21 +230,21 @@ meta:
* 假设您更新 Deployment 的时候,犯了一个拼写错误,将 `1.9.1` 写成了 `1.91`,如下图所示:
![Kubernetes-教程](./rollback.assets/image-20200315114441313.png)
![Kuboard-教程-Deployment-回滚](./rollback.assets/image-20210404183613285.png)
* 该更新将卡住,新的副本集中的 Pod 将因为抓取不到镜像而不能启动,并陷入不断抓取镜像的死循环当中,如下图所示:
![Kubernetes-教程](./rollback.assets/image-20200315114807304.png)
![Kuboard-教程-Deployment-回滚](./rollback.assets/image-20210404183808138.png)
## 检查 Deployment 的更新历史,并回滚
* 上图中,显示了该 Deployment 有三个副本集,分别对应 Deployment 的版本 `1`、`2`、`3`。点击某一个副本集上的 ***回滚*** 按钮Kuboard 将为您对比两个版本之间的差异,如下图所示:
* 上图中,显示了该 Deployment 有三个副本集,分别对应 Deployment 的版本 `1`、`2`、`3`。点击某一个副本集上的 ***回滚*** 按钮Kuboard 将为您对比两个版本之间的差异,如下图所示:
![Kubernetes-教程](./rollback.assets/image-20200315115224518.png)
![Kuboard-教程-Deployment-回滚](./rollback.assets/image-20210404183911945.png)
* 点击 **确认回滚** 按钮,将回滚到选定的版本
* 点击 **确认** 按钮,将回滚到选定的版本

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

View File

@ -93,11 +93,9 @@ meta:
## 执行伸缩
* 在 Deployment 详情页面,点击 ***伸缩*** 按钮,调整副本数并保存,如下图所示:
* 在 Deployment 详情页面,点击下图中 `向左箭头` 或 `向右箭头` 即可完成对 Deployment 的伸缩操作;
即可完成对 Deployment 的伸缩操作;
![Kubernetes-教程-伸缩](./scale.assets/image-20200315133044513.png)
![Kubernetes-教程-伸缩](./scale.assets/image-20210404184116094.png)
* `kubectl autoscale` 指令可以执行对 Deployment 的自动伸缩,目前 Kuboard 界面还不支持此操作。
@ -119,29 +117,29 @@ meta:
修改后保存。
![Kubernetes-教程](./scale.assets/image-20200315135123901.png)
![Kubernetes-教程](./scale.assets/image-20210404184525753.png)
* 确认当前 10 个副本正在运行,如下图所示:
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20200315135701001.png)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20210404184759213.png)
* 点击 ***调整镜像标签*** 按钮,将容器镜像更新到一个不存在的标签,例如 `sometag`,如下图所示:
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20200315135949626.png)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20210404184712639.png)
* 此时Deployment 将新建一个副本集,并且其期望的副本数为 `5`,原来的副本集的期望副本数被调整为 `8`,如下图所示:
由于新副本集中的 Pod 不能获取到镜像,因此滚动更新将卡在这个位置。
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20200315140245614.png)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20210404184920104.png)
* 点击 ***伸缩*** 按钮,将期望副本数调整为 `15`,如下图所示:
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20200315140447782.png)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20210404185426429.png)
* 此时,由于比原来期望的副本数增加了 5新增副本数将按比例增加到新、旧两个副本集,最终结果如下图所示:
* 此时,由于比原来期望的副本数增加了 5新增副本数将增加到旧副本集,最终结果如下图所示:(不同 Kubernetes 版本中,行为并不完全一致,比如,某些版本中,会将新增副本数按比例增加到新、旧副本集中,而截图中使用 Kubernetes v1.18,将所有新增副本数都增加到了旧副本集)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20200315140740451.png)
![Kubernetes-教程-按比例伸缩](./scale.assets/image-20210404185157096.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 KiB

View File

@ -20,7 +20,7 @@ Deployment 的生命周期中,将会进入不同的状态,这些状态可能
<b-card>
<b-tabs content-class="mt-3">
<b-tab title="使用 kubectl 查看 Deployment 状态" active>
<b-tab title="使用 kubectl 查看 Deployment 状态">
<h2>Progressing 状态</h2>
@ -162,13 +162,13 @@ $ echo $?
* 暂停pauseDeployment以对 Deployment 的 Pod template 执行多处更新
</b-tab>
<b-tab title="使用 Kuboard 查看 Deployment 状态">
<b-tab title="使用 Kuboard 查看 Deployment 状态" active>
在前面的处理中,您已经熟悉了 Kuboard 界面中如何管理 Deployment 的滚动更新过程。此外,还有少许 Deployment 的状态信息显示在运行时信息这个区块,如下图所示:
> 您也可以直接查看 Deployment 的 YAML 内容。
![Kubernetes-教程-查看Deployment状态](./status.assets/image-20200315163007630.png)
![Kubernetes-教程-查看Deployment状态](./status.assets/image-20210404190424295.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

View File

@ -17,7 +17,7 @@ meta:
Kuboard 中,可以通过如下界面编辑部署策略。
![Kubernetes-Deployment Strategy部署策略](./strategy.assets/image-20200315163608635.png)
![Kubernetes-Deployment Strategy部署策略](./strategy.assets/image-20210404191259449.png)
其中字段的含义如下:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

View File

@ -151,13 +151,13 @@ meta:
1. 进入 Deployment 查看界面,如下图所示:
![Kubernetes-教程](./update.assets/image-20200315111231323.png)
![Kubernetes-教程-更新Deployment](./update.assets/image-20210404182058429.png)
2. 点击上图中的 ***调整镜像标签*** 按钮
将新版本字段修改为 `1.9.1`,并点击 ***确定*** 按钮,如下图所示:
![Kubernetes-教程](./update.assets/image-20200315111509644.png)
![Kubernetes-教程-更新Deployment-版本](./update.assets/image-20210404182203934.png)
@ -165,11 +165,11 @@ meta:
更新过程中,截图如下:
![Kubernetes-教程](./update.assets/image-20200315111838761.png)
![Kubernetes-教程-更新Deployment-开始更新](./update.assets/image-20210404182350539.png)
完成更新后,截图如下:
![Kubernetes-教程](./update.assets/image-20200315113204869.png)
![Kubernetes-教程-更新Deployment-更新完成](./update.assets/image-20210404183433437.png)