From 21945b816a7e6c05b46768df06b2f6b5f8eb3060 Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Wed, 22 Jan 2025 15:17:32 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E5=A2=9E=E5=8A=A0=20k8s=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=8E=AF=E5=A2=83=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ init-all.sh | 1 + init-k8s.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 init-k8s.sh diff --git a/README.md b/README.md index 099ef3f..0bfaa9c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-npm.sh | curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-pip.sh | bash # git curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-git.sh | bash +# k8s +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-k8s.sh | bash # 初始化全部 diff --git a/init-all.sh b/init-all.sh index 8643d52..fc80570 100644 --- a/init-all.sh +++ b/init-all.sh @@ -13,6 +13,7 @@ download_and_run() { fi fi bash "$filename" + rm "$filename" } diff --git a/init-k8s.sh b/init-k8s.sh new file mode 100644 index 0000000..d8f8a66 --- /dev/null +++ b/init-k8s.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# 更新 apt +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash + +# k8s 相关环境 +apt install -y curl apt-transport-https ca-certificates gnupg + +# 调整内核 关闭 swap +cat < /dev/null +sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml +tee -a /etc/containerd/config.toml > /dev/null <