本文介绍了是否可以更改service-cluster-ip-range?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用尽了免费IP,无法在测试群集中使用服务,并且我想将service-cluster-ip-range更改为新的CIDR.我想知道它是否受支持以及如何执行.

I'm running out of free IP for services in a test cluster and I want to change service-cluster-ip-range to a new CIDR. I want to know if it's supported and how to do this.

运行K8s 1.12.3,CoreDNS和Calico

Running K8s 1.12.3, CoreDNS and Calico

在调查此问题期间,我发现没有任何官方文档可以提供帮助.

During my investigation of this issue I found no official documentation that could provide any help.

我为kube-apiserver和kube-controller-manager修改了--service-cluster-ip-range,以匹配新范围.

I modified --service-cluster-ip-range for kube-apiserver and kube-controller-manager to match a new range.

然后我在所有主服务器上重新启动了kube-apiserver kube-controller-manager kube-scheduler并添加了新服务

I then restarted kube-apiserver kube-controller-manager kube-scheduler on all masters and added a new service

似乎新服务是使用新范围创建的,并且所有旧服务(包括群集IP)都得到了保留.即使在重新启动完整集群后(无论尝试如何),旧服务和新服务都可以工作.

It seems the new service was created with the new range and all old services, including cluster IP was kept. Both old and new services works, even after att full cluster restart (just to try).

推荐答案

基于此 github问题和其他我能找到的资源.来自Calico的另一个文档.这是详细说明用于Docker EE,但我认为这可能会有所帮助.

Based on this github issue and other resources I was able to find. Another from Calico documentation. Here is a detailed instruction for Docker EE but I think it can be helpful.

所以是可能的,真正的问题是什么将停止工作(持续多长时间?)以及您可以承受多少停机时间. Internet上有关重新创建群集的建议中有很多答案,如果可能的话,我可能会听取该建议.看来,添加新的CIDR然后停用旧的CIDR是可行的方法.

So yeah it is possible, the real issue is what will stop working (for how long?) and how much downtime you can afford. A lot of answers around in the Internet advice on recreating the cluster and if it is possible I would probably listen to that advice. It seems like adding the new CIDR and then deactivating the old one is the way to go.

如果这不可能,那么您可以尝试创建另一个测试集群,然后尝试在其中进行此更改,以查看可能出了什么问题.还要记住要重新创建群集中存在的节点(缩小到0,这样就可以重新创建计算机).

If that is not possible, you can try to create another test cluster and try this changes in there to see what can possibly go wrong. Also remember to recreate the nodes that are present in the cluster (scale down to 0 so the machines will be recreated).

这篇关于是否可以更改service-cluster-ip-range?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 07:02