Files
kuboard-press/learning/k8s-intermediate/workload/wl-deployment/cleanup.md
huanqing.shao 1b69a42777 vssue
2019-09-22 21:56:32 +08:00

32 lines
893 B
Markdown
Raw 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.

---
vssueId: 40
layout: LearningLayout
description: 本文描述了如何在 Kubernetes 中清理 Deployment 中旧的 ReplicaSet
---
# 清理策略
[返回 Deployment](./#deployment-概述)
通过 Deployment 中 `.spec.revisionHistoryLimit` 字段,可指定为该 Deployment 保留多少个旧的 ReplicaSet。超出该数字的将被在后台进行垃圾回收。该字段的默认值是 10。
::: tip
如果该字段被设为 0Kubernetes 将清理掉该 Deployment 的所有历史版本revision因此您将无法对该 Deployment 执行回滚操作 `kubectl rollout undo`
:::
<!-- <el-tabs type="border-card">
<el-tab-pane label="使用 kubectl 指定 revisionHistroyLimit">
正在撰写中
</el-tab-pane>
<el-tab-pane label="使用 Kuboard 指定 revisionHistroyLimit">
正在撰写中
</el-tab-pane>
</el-tabs> -->
[返回 Deployment](./#deployment-概述)