diff --git a/seichi-onp-k8s/cluster-boot-up/scripts/nodes/k8s-node-setup.sh b/seichi-onp-k8s/cluster-boot-up/scripts/nodes/k8s-node-setup.sh index a34be9123..1c78dc4cf 100644 --- a/seichi-onp-k8s/cluster-boot-up/scripts/nodes/k8s-node-setup.sh +++ b/seichi-onp-k8s/cluster-boot-up/scripts/nodes/k8s-node-setup.sh @@ -80,22 +80,16 @@ EOF sudo sysctl --system ## Install containerd -apt-get update && apt-get install -y apt-transport-https curl gnupg2 -sudo mkdir -p /etc/apt/keyrings -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -sudo apt-get update && sudo apt-get install -y containerd.io +sudo apt-get update && sudo apt-get install -y containerd apt-transport-https curl gnupg2 # Configure containerd sudo mkdir -p /etc/containerd sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null -sudo sed -i 's#sandbox_image = "registry.k8s.io/pause:3.6"#sandbox_image = "registry.k8s.io/pause:3.9"#g' /etc/containerd/config.toml -if grep -q "SystemdCgroup = true" "/etc/containerd/config.toml"; then +sudo sed -i 's#sandbox_image = "registry.k8s.io/pause:3.8"#sandbox_image = "registry.k8s.io/pause:3.9"#g' /etc/containerd/config.toml +if grep -q "systemd_cgroup = true" "/etc/containerd/config.toml"; then echo "Config found, skip rewriting..." else -sed -i -e "s/SystemdCgroup \= false/SystemdCgroup \= true/g" /etc/containerd/config.toml +sed -i -e "s/systemd_cgroup \= false/systemd_cgroup \= true/g" /etc/containerd/config.toml fi sudo systemctl restart containerd @@ -117,7 +111,6 @@ sysctl --system # Install kubeadm 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 -apt-get update apt-get install -y kubeadm=1.28.4-1.1 kubectl=1.28.4-1.1 kubelet=1.28.4-1.1 apt-mark hold kubelet kubectl @@ -193,7 +186,7 @@ EOF echo "net.ipv4.ip_nonlocal_bind = 1" >> /etc/sysctl.conf sysctl -p -apt-get update && apt-get -y install keepalived +apt-get -y install keepalived cat > /etc/keepalived/keepalived.conf <