message
This commit is contained in:
parent
641b033bf1
commit
3ce7aba5b1
@ -5,16 +5,27 @@
|
|||||||
# this script supports Ubuntu 20.04 LTS and later only
|
# this script supports Ubuntu 20.04 LTS and later only
|
||||||
# run this script with sudo
|
# run this script with sudo
|
||||||
|
|
||||||
if ! [ $USER = root ]
|
if ! [ -f /tmp/container.txt ]
|
||||||
then
|
then
|
||||||
echo run this script with sudo
|
echo run ./setup-container.sh before running this script
|
||||||
exit 3
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# setting MYOS variable
|
# setting MYOS variable
|
||||||
MYOS=$(hostnamectl | awk '/Operating/ { print $3 }')
|
MYOS=$(hostnamectl | awk '/Operating/ { print $3 }')
|
||||||
OSVERSION=$(hostnamectl | awk '/Operating/ { print $4 }')
|
OSVERSION=$(hostnamectl | awk '/Operating/ { print $4 }')
|
||||||
|
|
||||||
|
# detecting latest Kubernetes version
|
||||||
|
KUBEVERSION=$(curl -s https://api.github.com/repos/kubernetes/kubernetes/releases/latest | jq -r '.tag_name')
|
||||||
|
KUBEVERSION=${KUBEVERSION%.*}
|
||||||
|
|
||||||
|
# setting previous version
|
||||||
|
VERSION=${KUBEVERSION#*.}
|
||||||
|
PREVIOUSVERSION=$(( VERSION - 1 ))
|
||||||
|
echo $PREVIOUSVERSION
|
||||||
|
exit
|
||||||
|
|
||||||
|
|
||||||
if [ $MYOS = "Ubuntu" ]
|
if [ $MYOS = "Ubuntu" ]
|
||||||
then
|
then
|
||||||
echo RUNNING UBUNTU CONFIG
|
echo RUNNING UBUNTU CONFIG
|
||||||
@ -23,23 +34,24 @@ then
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
|
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
|
||||||
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
curl -fsSL https://pkgs.k8s.io/core:/stable:/${KUBEVERSION}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
||||||
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/${KUBEVERSION}/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
sleep 2
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y kubelet kubeadm kubectl
|
sudo apt-get install -y kubelet kubeadm kubectl
|
||||||
sudo apt-mark hold kubelet kubeadm kubectl
|
sudo apt-mark hold kubelet kubeadm kubectl
|
||||||
swapoff -a
|
sudo swapoff -a
|
||||||
|
|
||||||
sed -i 's/\/swap/#\/swap/' /etc/fstab
|
sudo sed -i 's/\/swap/#\/swap/' /etc/fstab
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set iptables bridging
|
# Set iptables bridging
|
||||||
cat <<EOF > /etc/sysctl.d/k8s.conf
|
sudo cat <<EOF > /etc/sysctl.d/k8s.conf
|
||||||
net.bridge.bridge-nf-call-ip6tables = 1
|
net.bridge.bridge-nf-call-ip6tables = 1
|
||||||
net.bridge.bridge-nf-call-iptables = 1
|
net.bridge.bridge-nf-call-iptables = 1
|
||||||
EOF
|
EOF
|
||||||
sysctl --system
|
sudo sysctl --system
|
||||||
|
|
||||||
sudo crictl config --set \
|
sudo crictl config --set \
|
||||||
runtime-endpoint=unix:///run/containerd/containerd.sock
|
runtime-endpoint=unix:///run/containerd/containerd.sock
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user