Add initial script for k8s deployment
This commit is contained in:
parent
d155b61ac9
commit
334c190ad9
1 changed files with 14 additions and 0 deletions
14
install-k8s.sh
Executable file
14
install-k8s.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
while [ $# -ge 1 ]; do
|
||||
host="$1"; shift
|
||||
echo "Installing on $host ..."
|
||||
ssh root@$host "
|
||||
apt-get update && apt-get install -y apt-transport-https curl;
|
||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -;
|
||||
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
|
||||
deb https://apt.kubernetes.io/ kubernetes-xenial main
|
||||
EOF"
|
||||
ssh root@$host "apt-get update; apt-get install -y kubeadm kubectl; apt-mark hold kubelet kubeadm kubectl"
|
||||
|
||||
done
|
Loading…
Reference in a new issue