Files
website/content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md
Zach Corleissen abcee2dccd Update localization guidelines (#10485)
* Update localization guidelines for language labels

Continuing work

Continuing work

Continuing work

More work in progress

Add local OWNERS folders

Add an OWNERS file to Chinese

Remove shortcode for repos

Add Japanese

Alphabetize languages, change weights accordingly

More updates

Add Korean in Korean

Add English to languageName

Feedback from gochist

Move Chinese content from cn/ to zh/

Move OWNERS from cn/ to zh/

Resolve merge conflicts by updating from master

Add files back in to prep for resolution

After rebase on upstream/master, remove files

Review and update localization guidelines

Feedback from gochist, tnir, cstoku

Add a trailing newline to content/ja/OWNERS

Add a trailing newline to content/zh/OWNERS

Drop requirement for GH repo project

Clarify language about forks/branches

Edits and typos

Remove a shortcode specific to a multi-repo language setup

Update aliases and owners

Add explicit OWNERS for content/en

Migrate content from Chinese repo, update regex in config.toml

Remove untranslated strings

Add trailing newline to content/en/OWNERS

Add trailing newlines to OWNERS files

add Jaguar project description (#10433)

* add Jaguar project description

[Jaguar](https://gitlab.com/sdnlab/jaguar) is an open source solution for Kubernetes's network based on OpenDaylight.
Jaguar provides overlay network using vxlan and Jaguar CNIPlugin provides one IP address per pod.

* Minor newline tweak

blog post for azure vmss (#10538)

Add microk8s to pick-right-solution.md (#10542)

* Add microk8s to pick-right-solution.md

Microk8s is a single-command installation of upstream Kubernetes on any Linux and should be included in the list of local-machine solutions.

* capitalized Istio

Add microk8s to foundational.md (#10543)

* Add microk8s to foundational.md

Adding microk8s as credible and stable alternative to get started with Kubernetes on a local machine. This is especially attractive for those not wanting to incur the overhead of running a VM for a local cluster.

* Update foundational.md

Thank you for your suggestions! LMK if this works now?

* Rewrote first paragraph

And included a bullet list of features of microk8s

* Copyedit

fix typo (#10545)

Fix the kubectl subcommands links. (#10550)

Signed-off-by: William Zhang <warmchang@outlook.com>

Fix command issue (#10515)

Signed-off-by: mooncake <xcoder@tenxcloud.com>

remove imported community files per issue 10184 (#10501)

networking.md: Markdown fix (#10498)

Fix front matter, federation command-line tools (#10500)

Clean up glossary entry (#10399)

update slack link (#10536)

typo in StatefulSet docs (#10558)

fix discription about horizontal pod autoscale (#10557)

Remove redundant symbols (#10556)

Fix issue #10520 (#10554)

Signed-off-by: William Zhang <warmchang@outlook.com>

Update api-concepts.md (#10534)

Revert "Fix command issue (#10515)"

This reverts commit c02a7fb9f9.

Update memory-constraint-namespace.md (#10530)

update memory request to 100MiB corresponding the yaml content

Blog: Introducing Volume Snapshot Alpha for Kubernetes (#10562)

* blog post for azure vmss

* snapshot blog post

Resolve merge conflicts in OWNERS*

Minor typo fix (#10567)

Not sure what's supposed to be here, proposing removing it.

* Feedback from gochist

Tweaks to feedback

* Feedback from ClaudiaJKang
2018-10-12 14:25:01 -07:00

140 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
approvers:
- janetkuo
title: 对 DaemonSet 执行回滚
content_template: templates/task
---
{{% capture overview %}}
本文展示了如何对 DaemonSet 执行回滚。
{{% /capture %}}
{{% capture prerequisites %}}
* DaemonSet 滚动升级历史和 DaemonSet 回滚特性仅在 Kubernetes 1.7 及以后版本的 `kubectl` 中支持。
* 确保您了解如何 [对 DaemonSet 执行滚动升级](/docs/tasks/manage-daemon/update-daemon-set/)。
{{% /capture %}}
{{% capture steps %}}
## 对 DaemonSet 执行回滚
### 步骤 1 找到想要 DaemonSet 回滚到的历史版本(revision
如果只想回滚到最后一个版本,可以跳过这一步。
列出 DaemonSet 的所有版本:
```shell
kubectl rollout history daemonset <daemonset-name>
```
该命令返回 DaemonSet 版本列表:
```shell
daemonsets "<daemonset-name>"
REVISION CHANGE-CAUSE
1 ...
2 ...
...
```
* 在创建时,DaemonSet 的变化原因从 `kubernetes.io/change-cause` 注解(annotation)复制到其版本中。 用户可以在 `kubectl` 中指定 `--record=true` ,将执行的命令记录在变化原因注解中。
执行以下命令,来查看指定版本的详细信息:
```shell
kubectl rollout history daemonset <daemonset-name> --revision=1
```
该命令返回相应版本的详细信息:
```shell
daemonsets "<daemonset-name>" with revision #1
Pod Template:
Labels: foo=bar
Containers:
app:
Image: ...
Port: ...
Environment: ...
Mounts: ...
Volumes: ...
```
### 步骤 2 回滚到指定版本
```shell
# 在 --to-revision 中指定您从步骤 1 中获取的版本序号
kubectl rollout undo daemonset <daemonset-name> --to-revision=<revision>
```
如果成功,命令会返回:
```shell
daemonset "<daemonset-name>" rolled back
```
如果 `--to-revision` 参数未指定,将选中最近的版本。
### 步骤 3 观察 DaemonSet 回滚进度
`kubectl rollout undo daemonset` 向服务器表明启动 DaemonSet 回滚。 真正的回滚是在服务器端异步完成的。
执行以下命令,来观察 DaemonSet 回滚进度:
```shell
kubectl rollout status ds/<daemonset-name>
```
回滚完成时,输出形如:
```shell
daemonset "<daemonset-name>" successfully rolled out
```
{{% /capture %}}
{{% capture discussion %}}
## 理解 DaemonSet 版本
在前面的 `kubectl rollout history` 步骤中,您获得了一个版本列表,每个版本都存储在名为
`ControllerRevision` 的资源中。 `ControllerRevision` 仅在 Kubernetes 1.7 及以后的版本中可用。
查找原始的版本资源,来查看每个版本中存储了什么内容:
```shell
kubectl get controllerrevision -l <daemonset-selector-key>=<daemonset-selector-value>
```
该命令返回 `ControllerRevisions` 列表:
```shell
NAME CONTROLLER REVISION AGE
<daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 1 1h
<daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 2 1h
```
每个 `ControllerRevision` 中存储了相应 DaemonSet 版本的注解和模板。
`kubectl rollout undo` 采用特定 `ControllerRevision` ,并用
`ControllerRevision` 中存储的模板代替 DaemonSet 的模板。
`kubectl rollout undo` 相当于通过其他命令(如 `kubectl edit` 或 `kubectl apply`)将 DaemonSet 模板更新至先前的版本。
注意 DaemonSet 版本只会向前滚动。 也就是说,回滚完成后,所回滚到的 `ControllerRevision` 版本号 (`.revision` 字段) 会增加。 例如,如果用户在系统中有版本 1 和版本 2,并从版本 2 回滚到版本 1 ,带有 `.revision: 1` 的`ControllerRevision` 将变为 `.revision: 3`。
## 故障排除
* 查看 [DaemonSet 滚动升级故障排除](/docs/tasks/manage-daemon/update-daemon-set/#troubleshooting)。
{{% /capture %}}