Kubernetes缩小特定Pod [英] Kubernetes scale down specific pods

查看:93
本文介绍了Kubernetes缩小特定Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组Pod运行命令,可能需要花费几秒钟的时间.有一个过程可以跟踪打开的请求和请求在哪个Pod上运行.我希望在缩小Pod时使用该信息-通过指定要尝试退出的Pod或指定要关闭的Pod.更改副本数时是否可以指定这种类型的信息,例如我想要X个副本,请尝试不要杀死我在Pod A,B,C上长时间运行的任务?

I have a set of Pods running commands that can take up to a couple seconds. There is a process that keeps track of open request & which Pod the request is running on. I'd like the use that information when scaling down pods - either by specifying which pods to try to leave up, or specifying which pods to shut down. Is it possible to specify this type of information when changing the # of replicas, e.g. I want X replicas, try not to kill my long running tasks on pods A, B, C?

推荐答案

我一直在寻找自己的解决方案,但我也找不到开箱即用的解决方案. 但是,可能有一种解决方法(如果您可以测试并确认,将会非常喜欢)

i've been looking for a solution to this myself, and i also can't find one out of the box. however, there might be a workaround (would love it if you could test and confirm)

步骤:
1.删​​除复制控制器
2.删除所需的X个豆荚
3.重新创建大小为X的复制控制器

steps:
1. delete replication controller
2. delete X desired pods
3. recreate replication controller of size X

这篇关于Kubernetes缩小特定Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆