代码拉取完成,页面将自动刷新
同步操作将从 Wei Luo/wcni-kind 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
set -v
#1.Add alias
if [[ $(cat ~/.bashrc | grep cc | wc -l) -gt 0 ]];then echo "alias already exsits"
else
cat <<EOF>>~/.bashrc
alias wp="cd /root/wcni-kind"
alias gitc="git clone [email protected]:rowan-wcni/wcni-kind.git"
alias k="kubectl"
alias dip="kubectl get node -o wide"
alias kk="kubectl -nkube-system"
alias ds="docker ps"
alias cc="kubectl config get-contexts"
alias sc="kubectl config use-context $1"
alias lo="docker exec -it $1 $2"
alias all="kubectl get pods -A"
alias cls="kind get clusters $1"
alias cld="kind delete clusters $1"
EOF
fi
source ~/.bashrc > /dev/null 2>&1
#while true;do if [[ $(kubectl wait --for=condition=Ready nodes --all | grep met | wc -l) -eq $(kubectl get nodes -o name | wc -l) ]];then break;else sleep 1;fi;done
apt install sshpass >/dev/null 2>&1
for ip in {192.168.2.71,192.168.2.72,192.168.2.73}
do
sshpass -p hive ssh-copy-id -o StrictHostKeyChecking=no root@$ip -p 22 >/dev/null 2>&1
done
ssh 192.168.2.71 '
echo "
network:
version: 2
ethernets:
ens160:
addresses:
- 192.168.2.71/24
gateway4: 192.168.2.1
nameservers:
addresses:
- 192.168.2.1
search: []
" >/etc/netplan/01-network-manager-all.yaml && systemctl stop NetworkManager && systemctl disable NetworkManager && netplan apply'
ssh 192.168.2.72 '
echo "
network:
version: 2
ethernets:
ens160:
addresses:
- 192.168.2.72/24
gateway4: 192.168.2.1
nameservers:
addresses:
- 192.168.2.1
search: []
" >/etc/netplan/01-network-manager-all.yaml && systemctl stop NetworkManager && systemctl disable NetworkManager && netplan apply'
ssh 192.168.2.73 '
echo "
network:
version: 2
ethernets:
ens160:
addresses:
- 192.168.2.73/24
gateway4: 192.168.2.1
nameservers:
addresses:
- 192.168.2.1
search: []
" >/etc/netplan/01-network-manager-all.yaml && systemctl stop NetworkManager && systemctl disable NetworkManager && netplan apply'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。