-
Notifications
You must be signed in to change notification settings - Fork 1
/
upgrade.sh
executable file
·39 lines (32 loc) · 950 Bytes
/
upgrade.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
39
#!/bin/bash
####################################################################
# Kubernetes base installer for common
# - Code by Jioh L. Jung
####################################################################
####################################################################
# Setup values
#- Log files
TMP_LOG_FILE=$(mktemp /tmp/output.XXXXXXXXXX)
#- Root Check
if (( EUID != 0 )); then
echo "You must be root to do this." 1>&2
exit 1
fi
#- Move Script directory as base
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${BASE_DIR}"
#- Imports configure & functions
if [ -f "config" ]; then
chmod +x config
. ./config
fi
. ./default
. libs/functions
####################################################################
. ./install-common.sh
if [ -f "${HOME}/.kube/config" ]; then
kubeadm upgrade plan
kubeadm upgrade apply -f -y v${K8S_VERSION_TMP}
fi
sleep 3
systemctl restart kubelet