diff --git a/init-apt.sh b/init-apt.sh index 5d44009..dc7b0f2 100644 --- a/init-apt.sh +++ b/init-apt.sh @@ -28,6 +28,7 @@ server ntp5.aliyun.com iburst driftfile /var/lib/chrony/drift allow 127.0.0.1 EOF + timedatectl set-timezone Asia/Shanghai systemctl restart chrony && systemctl enable chrony else echo "systemctl 不存在,跳过 chrony 的重启" diff --git a/init-k8s.sh b/init-k8s.sh index 9785e9e..46b8314 100644 --- a/init-k8s.sh +++ b/init-k8s.sh @@ -39,11 +39,11 @@ sudo mv containerd.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl start containerd sudo systemctl enable --now containerd -sudo systemctl status containerd + # 初始化 containerd 配置 mkdir "/etc/containerd" -containerd config default | sudo tee /etc/containerd/config.toml > /dev/null +containerd config default > /etc/containerd/config.toml sed -ri '0,/(config_path).*/s@(config_path).*@\1 = "/etc/containerd/certs.d"@' /etc/containerd/config.toml sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml @@ -94,7 +94,7 @@ server = "https://registry.k8s.io" override_path = true EOF -sudo systemctl restart containerd && sudo systemctl enable containerd +sudo systemctl restart containerd && sudo systemctl enable --now containerd # ctr image pull registry.k8s.io/pause:3.10 # ctr image pull --hosts-dir /etc/containerd/certs.d registry.k8s.io/pause:3.10 diff --git a/k8s/README.md b/k8s/README.md new file mode 100644 index 0000000..804fc48 --- /dev/null +++ b/k8s/README.md @@ -0,0 +1,71 @@ +## +```bash +# 配置主机 host +cat >> /etc/hosts <