90DaysOfDevOps/Days/Kubernetes/scripts/node.sh
2022-02-24 20:14:10 +00:00

14 lines
443 B
Bash

#! /bin/bash
/bin/bash /vagrant/configs/join.sh -v
sudo -i -u vagrant bash << EOF
mkdir -p /home/vagrant/.kube
sudo cp -i /vagrant/configs/config /home/vagrant/.kube/
sudo chown 1000:1000 /home/vagrant/.kube/config
NODENAME=$(hostname -s)
kubectl label node $(hostname -s) node-role.kubernetes.io/worker=worker-new
EOF
sudo systemctl restart systemd-resolved
sudo swapoff -a && sudo systemctl daemon-reload && sudo systemctl restart kubelet