Skip to content

use kubeconfig explicitly #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: vmware
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bootstrap-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ echo "::set-output name=extra_node_ip::${mnodes[0]}"

echo "cleaning up old K8s cluster..."

kubeconfig=/etc/rancher/k3s/k3s.yaml


for node_ip in ${mnodes[@]}; do
Expand Down Expand Up @@ -157,8 +158,8 @@ for ((i=1; i<${#mnodes[@]}; i++)); do
sudo sysctl --system
"

NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl get nodes -o wide | grep -w ${mnodes[${i}]} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl label nodes $NODE_NAME type=simplyblock-cache --overwrite"
NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl get nodes -o wide | grep -w ${mnodes[${i}]} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl label nodes $NODE_NAME type=simplyblock-cache --overwrite"
done

if [ "$K8S_SNODE" == "true" ]; then
Expand Down Expand Up @@ -193,8 +194,8 @@ if [ "$K8S_SNODE" == "true" ]; then
sudo sysctl --system
"

NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl get nodes -o wide | grep -w ${node} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl label nodes $NODE_NAME type=simplyblock-storage-plane --overwrite"
NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl get nodes -o wide | grep -w ${node} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl label nodes $NODE_NAME type=simplyblock-storage-plane --overwrite"
done

for node in ${sec_storage_private_ips[@]}; do
Expand Down Expand Up @@ -227,7 +228,7 @@ if [ "$K8S_SNODE" == "true" ]; then
sudo sysctl --system
"

NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl get nodes -o wide | grep -w ${node} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "kubectl label nodes $NODE_NAME type=simplyblock-storage-plane-reserve --overwrite"
NODE_NAME=$(ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl get nodes -o wide | grep -w ${node} | awk '{print \$1}'")
ssh -i $KEY -o StrictHostKeyChecking=no root@${mnodes[0]} "KUBECONFIG=${kubeconfig} kubectl label nodes $NODE_NAME type=simplyblock-storage-plane-reserve --overwrite"
done
fi