diff --git a/configs/k8s_ha/check_apiserver.sh b/configs/k8s_ha/check_apiserver.sh index b923dd027..7beca7b22 100755 --- a/configs/k8s_ha/check_apiserver.sh +++ b/configs/k8s_ha/check_apiserver.sh @@ -5,7 +5,7 @@ errorExit() { exit 1 } -curl --silent --max-time 2 --insecure https://localhost:8443/ -o /dev/null || errorExit "Error GET https://localhost:8443/" +curl --silent --max-time 2 --insecure https://localhost:6443/ -o /dev/null || errorExit "Error GET https://localhost:6443/" if ip addr | grep -q 10.0.1.254; then - curl --silent --max-time 2 --insecure https://10.0.1.254:8443/ -o /dev/null || errorExit "Error GET https://10.0.1.254:8443/" + curl --silent --max-time 2 --insecure https://10.0.1.254:6443/ -o /dev/null || errorExit "Error GET https://10.0.1.254:6443/" fi \ No newline at end of file diff --git a/configs/k8s_ha/haproxy.cfg b/configs/k8s_ha/haproxy.cfg index 6c72ec2da..b1dbe46d5 100644 --- a/configs/k8s_ha/haproxy.cfg +++ b/configs/k8s_ha/haproxy.cfg @@ -32,7 +32,7 @@ defaults # apiserver frontend which proxys to the control plane nodes #--------------------------------------------------------------------- frontend apiserver - bind *:8443 + bind *:6443 mode tcp option tcplog default_backend apiserverbackend diff --git a/configs/setup/kube.json b/configs/setup/kube.json index 165cbc731..d5eea6fb2 100644 --- a/configs/setup/kube.json +++ b/configs/setup/kube.json @@ -9,5 +9,5 @@ "ApiserverDiscoveryToken": "", "ApiserverCertificateKey": "", "CPHAEndpoint": "10.0.1.254", - "CPHAPort": "8443" + "CPHAPort": "6443" } \ No newline at end of file diff --git a/scripts/cluster/create_multinode_cluster.go b/scripts/cluster/create_multinode_cluster.go index 4ab8bb7fd..892d720c3 100644 --- a/scripts/cluster/create_multinode_cluster.go +++ b/scripts/cluster/create_multinode_cluster.go @@ -103,16 +103,11 @@ EOF'` // Deploy Kubernetes func DeployKubernetes(haReplicaCount int) error { utils.WaitPrintf("Deploying Kubernetes(version %s)", configs.Kube.K8sVersion) - masterNodeIp, iperr := utils.ExecShellCmd(`ip route | awk '{print $(NF)}' | awk '/^10\..*/'`) - if iperr != nil { - return iperr - } command := fmt.Sprintf(`sudo kubeadm init --v=%d \ ---apiserver-advertise-address=%s \ --cri-socket /run/containerd/containerd.sock \ --kubernetes-version %s \ ---pod-network-cidr="%s" `, configs.System.LogVerbosity, masterNodeIp, configs.Kube.K8sVersion, configs.Kube.PodNetworkCidr) +--pod-network-cidr="%s" `, configs.System.LogVerbosity, configs.Kube.K8sVersion, configs.Kube.PodNetworkCidr) if haReplicaCount > 0 { command += fmt.Sprintf(`\