From 4022aafe7c448bcdd911ae63fb19d362160487b5 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sun, 28 Jan 2024 11:05:27 +0000 Subject: [PATCH] 12 --- Makefile | 4 ++++ initialize-k8s-ctrlr.sh | 8 +++++++- install-containerd.sh | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ed02fe4..a8aa2d5 100644 --- a/Makefile +++ b/Makefile @@ -21,3 +21,7 @@ upgrade: clear-ctrlr: bash reset-ctrlr.sh + +remove-containerd: + apt update + apt purge -y containerd diff --git a/initialize-k8s-ctrlr.sh b/initialize-k8s-ctrlr.sh index 8565fae..7f4a2a2 100755 --- a/initialize-k8s-ctrlr.sh +++ b/initialize-k8s-ctrlr.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash -kubeadm init --control-plane-endpoint=172.16.250.216 --node-name $(hostname -f ) --pod-network-cidr=10.244.0.0/16 +kubeadm config images pull --cri-socket /run/containerd/containerd.sock + +kubeadm init \ + --pod-network-cidr=10.244.0.0/16 \ + --upload-certs \ + --node-name $(hostname -f ) + --control-plane-endpoint=$(hostname -f ) diff --git a/install-containerd.sh b/install-containerd.sh index 90cf26a..f18a183 100755 --- a/install-containerd.sh +++ b/install-containerd.sh @@ -8,7 +8,8 @@ mkdir -p /etc/containerd containerd config default | tee /etc/containerd/config.toml -sed -i -e "s@SystemdCgroup = false@SystemdCgroup = true@g" /etc/containerd/config.toml +sed -i -e "s@SystemdCgroup = false@SystemdCgroup = true@g" \ + /etc/containerd/config.toml echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/010-k8s.conf echo "br_netfilter" > /etc/modules-load.d/k8s.conf