crictl命令
# crictl 命令
github-install-containerd (opens new window) install crictl 1 (opens new window) github文档 (opens new window)
# pod
命令 | 说明 |
---|---|
crictl pods | 打印pod清单 |
crictl pods --name nginx-65899c769f-wv2gp | 名称打印 Pod 清单 |
crictl pods --label run=nginx | 根据标签打印 Pod 清单 |
# image 镜像
命令 | 说明 |
---|---|
crictl images | 打印所有镜像 |
crictl images nginx | 根据仓库打印镜像清单 |
crictl pull busybox | 拉取busybox镜像 |
# container 容器
命令 | 说明 |
---|---|
crictl ps -a | 打印所有容器清单 |
crictl ps | 正在运行的容器清单 |
crictl exec -i -t 1f73f2d81bf98 ls | 在运行的容器上执行ls命令 |
crictl exec -i -t 1f73f2d81bf98 bash | 在运行的容器上执行bash命令 |
# log 日志
命令 | 说明 |
---|---|
crictl logs 87d3992f84f74 | 获取容器的所有日志 |
crictl logs --tail=N 87d3992f84f74 | 获取最近的 N 行日志 |
cat >> /etc/hosts << EOF
127.0.0.1 $(hostname)
10.0.20.6 master
10.0.8.13 node2
10.0.8.12 node1
43.138.161.91 master
43.138.197.127 node2
43.138.215.165 node1
EOF
cat >> /etc/NetworkManager/conf.d/rke2-canal.conf << EOF
[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:flannel*
EOF
systemctl reload NetworkManager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cat >> /etc/hosts << EOF 127.0.0.1 $(hostname) 10.0.20.6 master 10.0.8.13 node2 10.0.8.12 node1 43.138.161.91 master 43.138.197.127 node2 43.138.215.165 node1 EOF
curl -LO https://dl.k8s.io/release/v1.22.13/bin/linux/amd64/kubectl
编辑 (opens new window)