Update kubernetes installation to load br_netfilter and use version 1.26.15 14/14614/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 3 Oct 2024 08:49:26 +0000 (10:49 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 3 Oct 2024 11:51:54 +0000 (13:51 +0200)
Change-Id: Ica8e9c1baf4ea16d125ab79e992c4e3f7043f6ee
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/install_kubeadm_cluster.sh

index 793e7da..108a8ea 100755 (executable)
@@ -16,7 +16,7 @@
 set +eux
 
 K8S_VERSION=1.26
-K8S_PACKAGE_VERSION="$K8S_VERSION".5-1.1
+K8S_PACKAGE_VERSION="$K8S_VERSION".15-1.1
 
 # installs kubernetes packages
 function install_kube() {
@@ -50,6 +50,10 @@ function check_and_track_kube_install() {
 # initializes kubernetes control plane
 function init_kubeadm() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+    sudo modprobe br_netfilter
+    echo "br_netfilter" | sudo tee /etc/modules-load.d/k8s.conf
+    sudo sysctl -w net.bridge.bridge-nf-call-iptables=1
+    echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee /etc/sysctl.d/k8s.conf
     sudo swapoff -a
     sudo sed -i.bak '/.*none.*swap/s/^\(.*\)$/#\1/g' /etc/fstab
     sudo kubeadm init --config $1 --dry-run || FATAL_TRACK k8scluster "kubeadm init dry-run failed"