1 Star 0 Fork 45

chen-sir/wcni-kind

forked from Wei Luo/wcni-kind 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
env.sh 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
Wei Luo 提交于 2023-05-29 13:57 . add 1-proxy-arp and 2-ipip
#!/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'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rojer.chen/wcni-kind.git
[email protected]:rojer.chen/wcni-kind.git
rojer.chen
wcni-kind
wcni-kind
master

搜索帮助