Skip to content

Instantly share code, notes, and snippets.


yukirii/ Secret

Last active Dec 15, 2019
What would you like to do?
## Wait other apt process
while fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
echo "Wait other apt process..."
sleep 5
## Install required packages
apt-get update && apt-get install -y apt-transport-https \
curl \
ca-certificates \
gnupg-agent \
software-properties-common \
## Install Docker
curl -fsSL | apt-key add -
add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
apt-get update && apt-get install -y docker-ce docker-ce-cli
## Install Kubernetes packages
curl -s | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb kubernetes-xenial main
apt-get update && apt-get install -y kubelet=1.17.0-00 kubeadm=1.17.0-00 kubectl=1.17.0-00
apt-mark hold kubelet kubeadm kubectl
## Run cloud-init
cloud-init init --local
cloud-init init
cloud-init modules --mode=config
cloud-init modules --mode=final
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.