mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 16:37:34 +00:00
Fix bash comment style to single hash
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
参考[安装 Docker](../03_install/README.md) 一节添加 apt/yum 源,之后执行如下命令。
|
||||
|
||||
```bash
|
||||
## debian 系
|
||||
# debian 系
|
||||
|
||||
$ sudo apt install containerd.io
|
||||
|
||||
## rhel 系
|
||||
# rhel 系
|
||||
|
||||
$ sudo yum install containerd.io
|
||||
```
|
||||
@@ -103,7 +103,7 @@ kubelet 默认要求禁用 swap,否则可能导致初始化失败或节点无
|
||||
```bash
|
||||
$ sudo swapoff -a
|
||||
|
||||
## 如需永久禁用,可在 /etc/fstab 中注释 swap 对应行
|
||||
# 如需永久禁用,可在 /etc/fstab 中注释 swap 对应行
|
||||
```
|
||||
```bash
|
||||
$ cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
|
||||
@@ -112,7 +112,7 @@ net.ipv4.ip_forward = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
EOF
|
||||
|
||||
## 应用配置
|
||||
# 应用配置
|
||||
|
||||
$ sysctl --system
|
||||
```
|
||||
@@ -126,7 +126,7 @@ $ sysctl --system
|
||||
`/etc/systemd/system/kubelet.service.d/10-proxy-ipvs.conf` 写入以下内容
|
||||
|
||||
```bash
|
||||
## 启用 ipvs 相关内核模块
|
||||
# 启用 ipvs 相关内核模块
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/sbin/modprobe ip_vs
|
||||
@@ -247,7 +247,7 @@ CONTAINER_RUNTIME_ENDPOINT=unix:///run/containerd/containerd.sock crictl ps -a
|
||||
```bash
|
||||
$ kubectl get node -o yaml | grep CIDR
|
||||
|
||||
## 输出
|
||||
# 输出
|
||||
|
||||
podCIDR: 10.244.0.0/16
|
||||
podCIDRs:
|
||||
@@ -263,13 +263,13 @@ $ kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/v0.28.1/
|
||||
```bash
|
||||
$ kubectl taint nodes --all node-role.kubernetes.io/master-
|
||||
|
||||
## 部分较新版本使用 control-plane taint
|
||||
# 部分较新版本使用 control-plane taint
|
||||
|
||||
## $ kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||
# $ kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||
|
||||
## 恢复默认值
|
||||
# 恢复默认值
|
||||
|
||||
## $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
||||
# $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
@@ -21,27 +21,27 @@
|
||||
#### Ubuntu/Debian
|
||||
|
||||
```bash
|
||||
## 安装 cri-dockerd
|
||||
# 安装 cri-dockerd
|
||||
|
||||
$ cd /tmp
|
||||
$ wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.24/cri-dockerd-0.3.24.amd64.tgz
|
||||
$ tar xzvf cri-dockerd-0.3.24.amd64.tgz
|
||||
$ sudo mv cri-dockerd/cri-dockerd /usr/local/bin/
|
||||
|
||||
## 下载并安装 systemd service 文件
|
||||
# 下载并安装 systemd service 文件
|
||||
|
||||
$ wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.service
|
||||
$ wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.socket
|
||||
$ sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' cri-docker.service
|
||||
$ sudo mv cri-docker.service cri-docker.socket /etc/systemd/system/
|
||||
|
||||
## 启动 cri-dockerd
|
||||
# 启动 cri-dockerd
|
||||
|
||||
$ sudo systemctl daemon-reload
|
||||
$ sudo systemctl enable cri-docker
|
||||
$ sudo systemctl start cri-docker
|
||||
|
||||
## 验证安装
|
||||
# 验证安装
|
||||
|
||||
$ sudo /usr/local/bin/cri-dockerd --version
|
||||
```
|
||||
@@ -49,20 +49,20 @@ $ sudo /usr/local/bin/cri-dockerd --version
|
||||
#### CentOS/Fedora
|
||||
|
||||
```bash
|
||||
## 安装 cri-dockerd
|
||||
# 安装 cri-dockerd
|
||||
|
||||
$ cd /tmp
|
||||
$ wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.24/cri-dockerd-0.3.24.amd64.tgz
|
||||
$ tar xzvf cri-dockerd-0.3.24.amd64.tgz
|
||||
$ sudo mv cri-dockerd/cri-dockerd /usr/local/bin/
|
||||
|
||||
## 下载并安装 systemd service 文件
|
||||
# 下载并安装 systemd service 文件
|
||||
|
||||
$ wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.service
|
||||
$ wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.socket
|
||||
$ sudo mv cri-docker.service cri-docker.socket /etc/systemd/system/
|
||||
|
||||
## 启动 cri-dockerd
|
||||
# 启动 cri-dockerd
|
||||
|
||||
$ sudo systemctl daemon-reload
|
||||
$ sudo systemctl enable cri-docker
|
||||
@@ -134,7 +134,7 @@ $ sudo modprobe br_netfilter
|
||||
```bash
|
||||
$ sudo swapoff -a
|
||||
|
||||
## 如需永久禁用,可在 /etc/fstab 中注释 swap 对应行
|
||||
# 如需永久禁用,可在 /etc/fstab 中注释 swap 对应行
|
||||
```
|
||||
```bash
|
||||
$ cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
|
||||
@@ -143,7 +143,7 @@ net.ipv4.ip_forward = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
EOF
|
||||
|
||||
## 应用配置
|
||||
# 应用配置
|
||||
|
||||
$ sysctl --system
|
||||
```
|
||||
@@ -157,7 +157,7 @@ $ sysctl --system
|
||||
`/etc/systemd/system/kubelet.service.d/10-proxy-ipvs.conf` 写入以下内容
|
||||
|
||||
```bash
|
||||
## 启用 ipvs 相关内核模块
|
||||
# 启用 ipvs 相关内核模块
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/sbin/modprobe ip_vs
|
||||
@@ -264,7 +264,7 @@ $ kubeadm join 192.168.199.100:6443 --token cz81zt.orsy9gm9v649e5lf \
|
||||
```bash
|
||||
$ kubectl get node -o yaml | grep CIDR
|
||||
|
||||
## 输出
|
||||
# 输出
|
||||
|
||||
podCIDR: 10.244.0.0/16
|
||||
podCIDRs:
|
||||
@@ -280,13 +280,13 @@ $ kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/v0.28.1/
|
||||
```bash
|
||||
$ kubectl taint nodes --all node-role.kubernetes.io/master-
|
||||
|
||||
## 部分较新版本使用 control-plane taint
|
||||
# 部分较新版本使用 control-plane taint
|
||||
|
||||
## $ kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||
# $ kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||
|
||||
## 恢复默认值
|
||||
# 恢复默认值
|
||||
|
||||
## $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
||||
# $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
@@ -26,7 +26,7 @@ brew install kind
|
||||
可以下载二进制文件:
|
||||
|
||||
```bash
|
||||
## Linux AMD64
|
||||
# Linux AMD64
|
||||
|
||||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64
|
||||
chmod +x ./kind
|
||||
|
||||
Reference in New Issue
Block a user