Commit a74a266a by tingweiwang

fix add_node

1 parent 27416575
Showing with 5 additions and 3 deletions
......@@ -2,12 +2,14 @@
etcd_ip=192.168.1.56
master_ip=192.168.1.56
harbor_host=192.168.1.56:5000
new_node=192.168.1.58
new_node=(
192.168.1.58
) #可以写多个node。每行一个。
interface=eno1
#########################################################sshpass
port=22
password=seetatech
for ip in $new_node
for ip in ${new_node[@]}
do
sshpass -p $password ssh-copy-id -i ~/.ssh/id_rsa.pub -p $port -o StrictHostKeyChecking=no root@$ip
done
......@@ -85,7 +87,7 @@ kubectl config use-context default --kubeconfig=bootstrap.kubeconfig
ansible new_node -m copy -a "src=/root/k8s/script/k8s/bootstrap.kubeconfig dest=/opt/kubernetes/cfg/ mode=644"
ansible new_node -m copy -a "src=/opt/kubernetes/cfg/token.csv dest=/opt/kubernetes/cfg/"
##############################################################################################
for new_node_ip in $new_node
for new_node_ip in ${new_node[@]}
do
cat >>/opt/kubernetes/cfg/kubelet.$new_node_ip<<EOF
KUBELET_OPTS="--logtostderr=false \
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!