CKS: fix control plane endpoint IP (#11720)

This commit is contained in:
Wei Zhou 2025-09-29 09:10:56 +02:00 committed by GitHub
parent 2c1aad4db8
commit 9cc88b8dcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -198,16 +198,16 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
String initArgs = ""; String initArgs = "";
if (haSupported) { if (haSupported) {
initArgs = String.format("--control-plane-endpoint %s:%d --upload-certs --certificate-key %s ", initArgs = String.format("--control-plane-endpoint %s:%d --upload-certs --certificate-key %s ",
controlNodeIp, serverIp,
CLUSTER_API_PORT, CLUSTER_API_PORT,
KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster)); KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster));
} }
initArgs += String.format("--apiserver-cert-extra-sans=%s", controlNodeIp); initArgs += String.format("--apiserver-cert-extra-sans=%s", serverIp);
initArgs += String.format(" --kubernetes-version=%s", getKubernetesClusterVersion().getSemanticVersion()); initArgs += String.format(" --kubernetes-version=%s", getKubernetesClusterVersion().getSemanticVersion());
k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterInitArgsKey, initArgs); k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterInitArgsKey, initArgs);
k8sControlNodeConfig = k8sControlNodeConfig.replace(ejectIsoKey, String.valueOf(ejectIso)); k8sControlNodeConfig = k8sControlNodeConfig.replace(ejectIsoKey, String.valueOf(ejectIso));
k8sControlNodeConfig = k8sControlNodeConfig.replace(etcdEndpointList, endpointList); k8sControlNodeConfig = k8sControlNodeConfig.replace(etcdEndpointList, endpointList);
k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sServerIp, controlNodeIp); k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sServerIp, serverIp);
k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sApiPort, String.valueOf(CLUSTER_API_PORT)); k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sApiPort, String.valueOf(CLUSTER_API_PORT));
k8sControlNodeConfig = k8sControlNodeConfig.replace(certSans, String.format("- %s", serverIp)); k8sControlNodeConfig = k8sControlNodeConfig.replace(certSans, String.format("- %s", serverIp));
k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sCertificate, KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster)); k8sControlNodeConfig = k8sControlNodeConfig.replace(k8sCertificate, KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster));