This commit is contained in:
sandervanvugt 2024-03-11 11:18:20 +01:00
parent d775fd2f25
commit 70e00e79fe
3 changed files with 14 additions and 18 deletions

View File

@ -9,8 +9,3 @@ Make sure the virtual machines meet the following requirements
For instructions on how to set up Ubuntu Server 22.04, see the document "Installing Ubuntu 22-04" in this Git repository. For instructions on how to set up Ubuntu Server 22.04, see the document "Installing Ubuntu 22-04" in this Git repository.
For information on getting started with VirtualBox, see this video: https://www.youtube.com/watch?v=4qwUHSaIJdY For information on getting started with VirtualBox, see this video: https://www.youtube.com/watch?v=4qwUHSaIJdY
JUNE 2023 NOTE: The Calico network plugin has been changing a lot lately. I recommend using the following command to install it:
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml
For more information, see the instructions at https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart to install the Calico network plugin.

View File

@ -22,17 +22,11 @@ then
br_netfilter br_netfilter
EOF EOF
### update 5-3-2024
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 -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
cat <<EOF | 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:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
# 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
# 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
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 swapoff -a
@ -49,4 +43,4 @@ sysctl --system
sudo crictl config --set \ sudo crictl config --set \
runtime-endpoint=unix:///run/containerd/containerd.sock runtime-endpoint=unix:///run/containerd/containerd.sock
echo 'after initializing the control node, follow instructions and use kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml to install the calico plugin (control node only). On the worker nodes, use sudo kubeadm join ... to join' echo 'after initializing the control node, follow instructions and use kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml to install the calico plugin (control node only). On the worker nodes, use sudo kubeadm join ... to join'

View File

@ -15,6 +15,13 @@ fi
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%.*}
echo "Latest Kubernetes version is: $latest_version"
if [ $MYOS = "Ubuntu" ] if [ $MYOS = "Ubuntu" ]
then then
echo RUNNING UBUNTU CONFIG echo RUNNING UBUNTU CONFIG
@ -29,8 +36,8 @@ EOF
# deb https://apt.kubernetes.io/ kubernetes-xenial main # deb https://apt.kubernetes.io/ kubernetes-xenial main
#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.29/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
sudo apt-get update sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl sudo apt-get install -y kubelet kubeadm kubectl
@ -49,4 +56,4 @@ sysctl --system
sudo crictl config --set \ sudo crictl config --set \
runtime-endpoint=unix:///run/containerd/containerd.sock runtime-endpoint=unix:///run/containerd/containerd.sock
echo 'after initializing the control node, follow instructions and use kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml to install the calico plugin (control node only). On the worker nodes, use sudo kubeadm join ... to join' echo 'after initializing the control node, follow instructions and use kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml to install the calico plugin (control node only). On the worker nodes, use sudo kubeadm join ... to join'