Skip to content

Commit

Permalink
docs: update kubernetes zh docs
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <majinjing3@gmail.com>
  • Loading branch information
jim3ma committed Sep 30, 2021
1 parent 3e2876e commit 1b07259
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions docs/zh-CN/ecosystem/Kubernetes-with-Dragonfly.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,58 @@

#### 1. Docker

> **不推荐在 docker 环境中使用蜻蜓**:1. 拉镜像没有 fallback 机制,2. 在未来的 Kubernetes 中已经废弃。
>
> 因为当前 Kubernetes 里的 `daemonset` 并不支持 `Surging Rolling Update` 策略,
> 一旦旧的 dfdaemon pod 被删除后,新的 dfdaemon 就再也拉取不了了。
> 当使用 Docker 时,在升级 dfdaemon 的时候,请先手动拉取新的 dfdaemon 镜像,或者使用 [ImagePullJob](https://openkruise.io/docs/user-manuals/imagepulljob)
> 不推荐在 docker 环境中使用蜻蜓:1. 拉镜像没有 fallback 机制,2. 在未来的 Kubernetes 中已经废弃。
> 如果无法更换容器运行时的话,那在升级蜻蜓的时候,请从下面两种方案选择比较适合的:
> 选项1:先手动拉取新的 dfdaemon 镜像,或者使用 [ImagePullJob](https://openkruise.io/docs/user-manuals/imagepulljob) 去自动拉取,
> 选项2:保持蜻蜓的镜像中心和通用的镜像中心不一样,同时将蜻蜓镜像中心相关的 host 加入 `containerRuntime.docker.skipHosts`
Dragonfly Helm 支持自动更改 docker 配置。

**情况 1: 支持指定仓库**
**情况 1:【推荐的】支持任意仓库**

定制 values.yaml 文件:
```yaml
containerRuntime:
docker:
enable: true
# -- Inject domains into /etc/hosts to force redirect traffic to dfdaemon.
# Caution: This feature need dfdaemon to implement SNI Proxy, confirm image tag is greater than v0.4.0.
# When use certs and inject hosts in docker, no necessary to restart docker daemon.
injectHosts: true
registryDomains:
- "harbor.example.com"
- "harbor.example.net"
# -- Restart docker daemon to redirect traffic to dfdaemon
# When containerRuntime.docker.restart=true, containerRuntime.docker.injectHosts and containerRuntime.registry.domains is ignored.
# If did not want restart docker daemon, keep containerRuntime.docker.restart=false and containerRuntime.docker.injectHosts=true.
restart: true
```
此配置允许 docker 通过 Dragonfly 拉取 `harbor.example.com` 和 `harbor.example.net` 域名镜像
使用上述配置部署 Dragonfly 时,无需重新启动 docker。
此配置允许 Dragonfly 拦截所有 docker 流量
使用上述配置部署 Dragonfly 时,dfdaemon 将重新启动 docker。
限制:
* 只支持指定域名。
* 必须开启 docker 的 `live-restore` 功能
* 需要重启 docker daemon

**情况 2: 支持任意仓库**
**情况 2: 支持指定仓库**

定制 values.yaml 文件:
```yaml
containerRuntime:
docker:
enable: true
# -- Restart docker daemon to redirect traffic to dfdaemon
# When containerRuntime.docker.restart=true, containerRuntime.docker.injectHosts and containerRuntime.registry.domains is ignored.
# If did not want restart docker daemon, keep containerRuntime.docker.restart=false and containerRuntime.docker.injectHosts=true.
restart: true
# -- Inject domains into /etc/hosts to force redirect traffic to dfdaemon.
# Caution: This feature need dfdaemon to implement SNI Proxy, confirm image tag is greater than v0.4.0.
# When use certs and inject hosts in docker, no necessary to restart docker daemon.
injectHosts: true
registryDomains:
- "harbor.example.com"
- "harbor.example.net"
```

此配置允许 Dragonfly 拦截所有 docker 流量
使用上述配置部署 Dragonfly 时,dfdaemon 将重新启动 docker。
此配置允许 docker 通过 Dragonfly 拉取 `harbor.example.com` 和 `harbor.example.net` 域名镜像
使用上述配置部署 Dragonfly 时,无需重新启动 docker。

限制:
* 必须开启 docker 的 `live-restore` 功能
* 需要重启 docker daemon
* 只支持指定域名。

#### 2. Containerd

Expand Down

0 comments on commit 1b07259

Please sign in to comment.