8.3. Pruning DeploymentConfig objects


In order to prune DeploymentConfig objects that are no longer required by the system due to age and status, administrators can run the following command:

$ oc adm prune deployments [<options>]
表 8.2. Prune deployments CLI configuration options
OptionDescription

--confirm

Indicate that pruning should occur, instead of performing a dry-run.

--orphans

Prune all deployments that no longer have a DeploymentConfig object, has status of Complete or Failed, and has a replica count of zero.

--keep-complete=<N>

Per the DeploymentConfig object, keep the last N deployments that have a status of Complete and replica count of zero. (default 5)

--keep-failed=<N>

Per the DeploymentConfig object, keep the last N deployments that have a status of Failed and replica count of zero. (default 1)

--keep-younger-than=<duration>

Do not prune any object that is younger than <duration> relative to the current time. (default 60m) Valid units of measurement include nanoseconds (ns), microseconds (us), milliseconds (ms), seconds (s), minutes (m), and hours (h).

To see what a pruning operation would delete:

$ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
    --keep-younger-than=60m

To actually perform the prune operation:

$ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
    --keep-younger-than=60m --confirm
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.