如何将Kubernetes主节点从一台服务器移动到另一台服务器? [英] How to move Kubernetes master node from one server to another?

查看:83
本文介绍了如何将Kubernetes主节点从一台服务器移动到另一台服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个节点的Kubernetes集群.一个人的角色是主人.

I have Kubernetes cluster with two nodes. One's role is Master.

我想将主节点移动到另一台物理服务器.

I want to move master node to another physical server.

我看到的可能方法是添加另一个节点并将其角色更改为主节点.

The possible way I see is to add another node and change its role to master.

我该怎么做?有什么指示吗? 这是唯一的方法吗?

How can I do that? Is there any kind of instructions? Is this the only way?

推荐答案

可能是迁移的副本Kubernetes Master

实际上,您只需要

  • 从磁盘克隆数据
  • 更改新服务器的身份(IP地址/DNS名称)

更新

如果要在kubeadm配置中更改主IP地址,请检查以下参考:

If you want to change master IP address in kubeadm config, check following references:

  • 替换/etc/kubernetes中所有配置文件中的IP地址
  • 备份/etc/kubernetes/pki
  • 识别/etc/kubernetes/pki中具有旧IP地址作为替代名称的证书
  • 同时删除它们的证书和密钥(对我来说,这只是apiserver和etcd/peer)
  • 使用kubeadm alpha阶段证书重新生成证书 2
  • 在引用旧IP的kube-system命名空间中标识configmap
  • 手动编辑这些配置映射 重新启动kubelet和docker(强制重新创建所有容器)
  • replacing the IP address in all config files in /etc/kubernetes
  • backing up /etc/kubernetes/pki
  • identifying certs in /etc/kubernetes/pki that have the old IP address as an alt name
  • deleting both the cert and key for each of them (for me it was just apiserver and etcd/peer)
  • regenerating the certs using kubeadm alpha phase certs2
  • identifying configmap in the kube-system namespace that referenced the old IP
  • manually editing those configmaps restarting kubelet and docker (to force all containers to be recreated)

或者逐步查看说明

这篇关于如何将Kubernetes主节点从一台服务器移动到另一台服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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