From 336aa998ad6d65489a46783fe4af2955c1ac2be2 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sat, 27 Jan 2024 17:33:25 +0000 Subject: [PATCH] 1 --- .gitignore | 1 + REFERENCES.md | 1 + install-containerd.sh | 17 +++++++++++++++++ install-kube-from-repo.sh | 14 ++++++++++++++ install-kubectl.sh | 29 +++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+) create mode 100644 .gitignore create mode 100644 REFERENCES.md create mode 100644 install-containerd.sh create mode 100755 install-kube-from-repo.sh create mode 100755 install-kubectl.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/REFERENCES.md b/REFERENCES.md new file mode 100644 index 0000000..da7efd7 --- /dev/null +++ b/REFERENCES.md @@ -0,0 +1 @@ +* diff --git a/install-containerd.sh b/install-containerd.sh new file mode 100644 index 0000000..dbf9618 --- /dev/null +++ b/install-containerd.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env + +apt install -y containerd + +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 + +echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/010-k8s.conf +echo "br_netfilter" > /etc/modules-load.d/k8s.conf + +sysctl --system +modpobe br_netfilter + +systemctl restart containerd diff --git a/install-kube-from-repo.sh b/install-kube-from-repo.sh new file mode 100755 index 0000000..9d85e20 --- /dev/null +++ b/install-kube-from-repo.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +apt install -y apt-transport-https ca-certificates curl gpg + +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | 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/ /' | \ + tee /etc/apt/sources.list.d/kubernetes.list + +apt update + +apt-get install -y kubelet kubeadm kubectl + +apt-mark hold kubelet kubeadm kubectl diff --git a/install-kubectl.sh b/install-kubectl.sh new file mode 100755 index 0000000..2f36d2a --- /dev/null +++ b/install-kubectl.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +apt install -y apt-transport-https ca-certificates curl wget + +mkdir -p bin + +wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ + -O ./bin/kubectl + +wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" \ + -O ./bin/kubectl.sha256 + +echo "$(cat ./bin/kubectl.sha256) ./bin/kubectl" | sha256sum --check + +install -o root -g root -m 0755 ./bin/kubectl /usr/local/bin/kubectl + +kubectl version --client + + +wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert" \ + -O ./bin/kubectl-convert + +wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256" \ + -O ./bin/kubectl-convert.sha256 + +echo "$(cat ./bin/kubectl-convert.sha256) ./bin/kubectl-convert" | sha256sum --check + + +install -o root -g root -m 0755 ./bin/kubectl-convert /usr/local/bin/kubectl-convert