-
Notifications
You must be signed in to change notification settings - Fork 4
/
k8s-node.sh
executable file
·58 lines (42 loc) · 1.33 KB
/
k8s-node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash -x
echo "This script is written to work with Ubuntu 18.04"
sleep 3
echo
echo "Disable swap until next reboot"
echo "swapoff should not needed on azure VM"
#sudo swapoff -a
echo "Update the VM image"
sudo apt-get update && sudo apt-get upgrade -y
echo
echo "Install Docker"
sleep 3
# get ubuntu version
# lsb_release -a
# Ubuntu 18.04.2 LTS
# sudo apt-get install -y \
# apt-transport-https \
# ca-certificates \
# curl \
# gnupg-agent \
# software-properties-common
#
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#
# sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable"
#
# sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu
# Ubuntu 16.04.6 LTS
#sudo apt-get install -y --allow-downgrades docker.io=18.06.1-0ubuntu1.2~16.04.1
sudo apt-get install -y docker.io
echo
echo "Install kubeadm and kubectl"
sleep 3
sudo sh -c "echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' >> /etc/apt/sources.list.d/kubernetes.list"
sudo sh -c "curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -"
sudo apt-get update
sudo apt-get install -y kubeadm=1.16.1-00 kubelet=1.16.1-00 kubectl=1.16.1-00
sudo apt-mark hold kubelet kubeadm kubectl
echo "k8s node configuration Done"