-
-
Save tracphil/d043e05f7e993180bc980f53f8b3179b to your computer and use it in GitHub Desktop.
Init script for kubernetes...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DEBIAN_FRONTEND=noninteractive | |
# Pre-phase. | |
apt update | |
apt upgrade -y | |
apt install -y ufw apt-transport-https ca-certificates curl software-properties-common grep | |
# Apt keys and deb lists. | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list | |
deb https://apt.kubernetes.io/ kubernetes-xenial main | |
EOF | |
# Install all! | |
apt-get update | |
apt-get install -y docker-ce docker-ce-cli containerd.io kubelet kubeadm | |
apt-mark hold kubelet kubeadm kubectl | |
# Ufw settings. | |
ufw allow ssh | |
ufw allow 6443/tcp | |
ufw allow 2379:2380/tcp | |
ufw allow http | |
ufw allow https | |
ufw allow 10250:10252/tcp | |
ufw --force enable | |
# Kube hates swap! | |
swapoff -a | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment