kubernetes:从 "stacked control plane + etc nodes" 迁移到 "cluster with external etcd nodes"

kubernetes : migrate from "stacked control plane + etc nodes" to "cluster with external etcd nodes"

我可能会问一个愚蠢的问题(在阅读官方 kubernetes 文档之后),但这是我的问题:

首先,我设置了一个 kubeadm 集群,其中包含 3 个堆叠的控制平面节点和 etcd + 1 个负载均衡器(etcd 成员和控制平面节点位于同一位置)+ n worker。

# kubectl get nodes
NAME                                             STATUS   ROLES    AGE   VERSION
pp-tmp-test20.xxx   Ready    master   17h   v1.15.1
pp-tmp-test21.xxx   Ready    master   15h   v1.15.2
pp-tmp-test22.xxx   Ready    master   15h   v1.15.2
pp-tmp-test23.xxx   Ready    worker   14h   v1.15.2
pp-tmp-test24.xxx   Ready    worker   15h   v1.15.2

有没有办法在不删除我的实际集群的情况下从这个拓扑迁移到 "kubadm cluster with external etcd cluster"。迁移到 3 个堆叠式控制平面节点 + 3 个 etcd 节点 + 1 个负载均衡器 + n 个 worker。

或者我必须设置一个新集群?

我想我在官方文档中找到了答案 (https://k0s.io/docs/setup/independent/high-availability/) :

"在继续之前,您应该仔细考虑哪种方法最能满足您的应用程序和环境的需要。这个比较主题概述了每种拓扑的优缺点。"

"Setting up a cluster with external etcd nodes is similar to the procedure used for stacked etcd with the exception that you should setup etcd first, and you should pass the etcd information in the kubeadm config file"

非常感谢您的帮助

此致 文森特

是的,您现在可以在外部系统上设置 etcd 节点并更新 kube-apiserver.yaml 文件中的以下参数。清单文件应该在控制平面节点的 /etc/kubernetes/manifests 目录中可用。

     --etcd-servers=https://<IP address of new etcd server>:2379