-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-kubernetes.sh
executable file
·38 lines (33 loc) · 1.06 KB
/
install-kubernetes.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
#!/bin/bash
set -e
function print-banner () {
local message="$1"
echo "##################################"
echo "$message"
echo "##################################"
}
function tune-kubernetes-config () {
print-banner "Bridge IPv4 traffic to iptables chains"
sudo sysctl net.bridge.bridge-nf-call-iptables=1
print-banner "Disabling Swap"
# To do
}
function main () {
print-banner "Updating apt sources list"
sudo apt-get update
print-banner "Installing ebtables ethtool"
sudo apt-get install ebtables ethtool
print-banner "Installing kubernetes: kubelet kubeadm kubectl"
# add kubernetes' official key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
}
if [ "$UID" -ne 0 ] ; then
echo "Please run as root"
else
tune-kubernetes-config
main "$@"
fi