gpt4 book ai didi

kubernetes - 通过 cli 在 pod 中配置资源限制

转载 作者:行者123 更新时间:2023-12-05 06:01:20 25 4
gpt4 key购买 nike

我正在尝试运行一个 pod,其中我的 GKE AutoPilot 集群的默认限制是 500m vCPU..但我只想通过 250m vCPU 运行我的所有 pod。我尝试了命令 kubectl run pod-0 --requests="cpu=150m"--restart=Never --image=example/only

但我收到警告:Flag --requests 已被弃用,没有任何效果,将来会被删除。然后当我描述我的 pod 时,它设置为 500m。我想知道使用简单的 kubectl run pod

设置资源限制的选项

最佳答案

从 kubectl v1.21 开始,所有生成器都被删除了。

Github 问题:Remove generators from kubectl commands引用:

kubectl command are going to get rid of the dependency to thegenerators, and ultimately remove them entirely. The main goal is tosimplyfy the use of kubectl command. This is already done in kubectlrun, see #87077 and #68132.

所以看起来 --limits--requests 标志在未来将不再可用。

这是执行此操作的 PR:Drop deprecated run flags and deprecate unused ones .

关于kubernetes - 通过 cli 在 pod 中配置资源限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67250644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com