Skip to content

Test Kubernetes binary update scripts

Davide Agnello edited this page Oct 20, 2016 · 2 revisions

Helpful scripts to update Kubernetes binaries for testing purposes

cat > updateAll.sh<< EOF
#!/bin/bash
set -x
export KEY=~/.ssh/id_rsa
export MASTER=10.247.82.239
./updateMaster.sh
export NODE=10.247.82.150
./updateNode.sh
EOF


cat > cloud.conf<< EOF
[Global]
user = [email protected]
password = Init123$
server = 10.247.81.78
port = 443
datacenter = FTC
datastore = san2
working-dir = steve-hcp
reuse-vcenter-sessions = true
insecure-flag = true
[Disk]
scsicontrollertype = pvscsi
EOF

cat > updateMaster.sh<< EOF
#!/bin/bash
set -x
sudo scp -i \$KEY -o StrictHostKeyChecking=no kube-vsphere-session-test/kube* ubuntu@\$MASTER:~ 
#sudo scp -i \$KEY -o StrictHostKeyChecking=no cloud.conf ubuntu@\$MASTER:~ 
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$MASTER -- "sudo service kubelet stop & sudo service kube-proxy stop & sudo service kube-controller-manager stop & sudo service kube-scheduler stop & sudo service kube-apiserver stop"
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$MASTER -- "sudo cp kube* /usr/bin/"
#sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$MASTER -- "sudo cp cloud.conf /etc/"
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$MASTER -- "sudo service kubelet start & sudo service kube-proxy start & sudo service kube-controller-manager start & sudo service kube-scheduler start & sudo service kube-apiserver start"
EOF

cat > updateNode.sh<< EOF
#!/bin/bash
set -x
sudo scp -i \$KEY -o StrictHostKeyChecking=no kube-vsphere-session-test/kube* ubuntu@\$NODE:~
sudo scp -i \$KEY -o StrictHostKeyChecking=no cloud.conf ubuntu@\$NODE:~ 
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$NODE -- "sudo service kubelet stop & sudo service kube-proxy stop"
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$NODE -- "sudo cp kube* /usr/bin/"
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$NODE -- "sudo cp cloud.conf /etc/"
sudo ssh -i \$KEY -o StrictHostKeyChecking=no ubuntu@\$NODE -- "sudo service kubelet start & sudo service kube-proxy start"
EOF
chmod +x update*