我可以在 kubernetes 初始化后更改 controlPlaneEndpoint 吗?

我可以在 kubernetes 初始化后更改 controlPlaneEndpoint 吗?

我是 Kubernetes 新手,这是我的 Kubernetes 版本信息

kubeadm version: &version.Info{
Major:"1",
Minor:"27", 
GitVersion:"v1.27.3", 
GitCommit:"25b4e43193bcda6c7328a6d147b1fb73a33f1598", 
GitTreeState:"clean", 
BuildDate:"2023-06-14T09:52:26Z", 
GoVersion:"go1.20.5", 
Compiler:"gc", 
Platform:"linux/amd64"
}

我想使用堆叠-etcd-拓扑形式。

这是我的 kubeadm init 配置文件

apiVersion: kubeadm.k8s.io/v1beta3
bootstrapTokens:
- groups:
  - system:bootstrappers:kubeadm:default-node-token
  token: abcdef.0123456789abcdef
  ttl: 24h0m0s
  usages:
  - signing
  - authentication
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: 192.168.44.135
  bindPort: 6443
nodeRegistration: 
  criSocket: unix:///var/run/cri-dockerd.sock
  imagePullPolicy: IfNotPresent 
  taints: null
---
apiServer:
  timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta3
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controllerManager: {}
dns: {}
etcd:
  local:
    dataDir: /data/paas/etcd
kind: ClusterConfiguration
kubernetesVersion: 1.27.3
networking:
  dnsDomain: cluster.local
  serviceSubnet: 10.96.0.0/12
  podSubnet: 10.244.0.0/16
scheduler: {}
controlPlaneEndpoint: "192.168.44.135:6443"  # load balancer, first control plane ip
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
cgroupDriver: systemd
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: ipvs

我将其设置controlPlaneEndpoint为第一个控制平面节点的 IP,因为我们之前的项目正在运行kube-vip并将Daemonset其用于负载平衡,我想controlPlaneEndpoint在安装后稍后进行配置kube-vip

我似乎没有在 kubernetes 文档中找到有关修改的任何内容controlPlaneEndpoint,我该如何做到这一点,如果不允许,我会尝试尽早安装负载平衡。

期待您的帮助。

相关内容