如何将Pod移动到新的节点池/实例组 [英] How do I move pods to a new node pool/ instance group

查看:164
本文介绍了如何将Pod移动到新的节点池/实例组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个附加了一个节点池的Gke集群

I have a Gke cluster with one node pool attached

我想对节点池进行一些更改,例如添加标签等

I want to make some changes to the node pool though- like adding tags, etc

因此,我使用新配置创建了一个新的节点池,并将其附加到集群.所以集群现在有2个节点池.

So I created a new node pool with my new config and attached to the cluster. so now cluster has 2 node pools.

这时我想将吊舱移至新的节点池并销毁旧的节点池

At this point I want to move the pods to the new node pool and destroy the old one

该过程如何完成?我这样做正确吗?

How is this process done? Am I doing this right?

推荐答案

有多种方法可以将吊舱移动到新的节点池.

There are multiple ways to move your pods to the new node pool.

一种方法是,使用Pod规范中的标签选择器将Pod引导到新的节点池,如

One way is to steer your pods to the new node pool using a label selector in your pod spec, as described in the "More fun with node pools" in the Google blog post that announced node pools (with the caveat that you need to forcibly terminate the existing pods for them to be rescheduled). This leaves all nodes in your cluster functional, and you can easily shift the pods back and forth between pools using the labels on the node pools (GKE automatically adds the node pool name as a label to make this easier).

另一种方法是遵循有关将工作负载迁移到其他机器类型,它描述了如何警戒/排空节点以将工作负载转移到新的节点池.

Another way is to follow the tutorial for Migrating workloads to different machine types, which describes how to cordon / drain nodes to shift workloads to the new node pool.

最后,您可以只使用GKE删除旧的节点池. GKE会在删除节点之前自动清空节点,这将导致您的工作负载转移到新池中,而无需您自己运行任何其他命令.

Finally, you can just use GKE to delete your old node pool. GKE will automatically drain nodes prior to deleting them, which will cause your workload to shift to the new pool without you needing to run any extra commands yourself.

这篇关于如何将Pod移动到新的节点池/实例组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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