Skip to content

Commit

Permalink
Fixing LB issues
Browse files Browse the repository at this point in the history
Signed-off-by: Lazar Cvetković <[email protected]>
  • Loading branch information
cvetkovic committed Feb 19, 2024
1 parent 3e89022 commit 61ee206
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions configs/k8s_ha/check_apiserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion configs/k8s_ha/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configs/setup/kube.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"ApiserverDiscoveryToken": "",
"ApiserverCertificateKey": "",
"CPHAEndpoint": "10.0.1.254",
"CPHAPort": "8443"
"CPHAPort": "6443"
}
7 changes: 1 addition & 6 deletions scripts/cluster/create_multinode_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(`\
Expand Down

0 comments on commit 61ee206

Please sign in to comment.