forked from janakiramm/do-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode.sh
27 lines (18 loc) · 783 Bytes
/
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
#!/bin/bash
set -ex
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): } $HOSTNAME $ '
export DEBIAN_FRONTEND=noninteractive
# Replace this with the token
TOKEN=xxxxxx.yyyyyyyyyyyyyyyy
MASTER_IP=xxx.xxx.xxx.xxx
apt-get update && apt-get upgrade -y
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 http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update -y
apt-get install -y docker.io
apt-get install -y --allow-unauthenticated kubelet kubeadm kubectl kubernetes-cni
kubeadm join --token $TOKEN $MASTER_IP:6443 --discovery-token-unsafe-skip-ca-verification
# Install DigitalOcean monitoring agent
curl -sSL https://agent.digitalocean.com/install.sh | sh