**1. 到网站[https://tool.lu/ip/](https://tool.lu/ip/)查看域名[raw.githubusercontent.com](http://raw.githubusercontent.com/)对应的IP地址**
![](https://img.kancloud.cn/aa/f4/aaf4186b540069734a1447f00b2d21f7_1402x595.png)
<br/>
**2. 添加 hosts【k8s-master1节点】**
```shell
# cat >> /etc/hosts << EOF
185.199.109.133 raw.githubusercontent.com
EOF
```
<br/>
**3. 下载文件`kube-flannel.yml`并应用【k8s-master1节点】**
```shell
# mkdir -p /opt/install/k8s/conf/
# cd /opt/install/k8s/conf/
# wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
# kubectl apply -f /opt/install/k8s/conf/kube-flannel.yml
```
<br/>
**4. 查看网络状态【k8s-master1节点】**
```shell
(1)查看状态
# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-5bbd96d687-k42cn 1/1 Running 0 80m
coredns-5bbd96d687-x9nnn 1/1 Running 0 80m
etcd-k8s-master1 1/1 Running 0 80m
kube-apiserver-k8s-master1 1/1 Running 0 80m
kube-controller-manager-k8s-master1 1/1 Running 0 80m
kube-proxy-28pz6 1/1 Running 0 80m
kube-proxy-kbbwr 1/1 Running 0 57m
kube-proxy-ncslh 1/1 Running 0 57m
kube-scheduler-k8s-master1 1/1 Running 0 80m
(2)等上面的状态全部为 Running 时,可以看到 k8s 各个节点为 Ready(已准备好)
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master1 Ready control-plane 82m v1.26.2
k8s-node1 Ready <none> 59m v1.26.2
k8s-node2 Ready <none> 59m v1.26.2
```
- k8sv1.21.14集群搭建
- 0. 适用版本
- 1. 集群架构
- 2. 机器初始化
- 3. 安装Docker
- 4. 配置k8s镜像仓库
- 5. 安装k8s核心工具
- 6. 初始化主节点
- 7. node节点加入集群
- 8. 安装Pod网络插件
- 9. 测试k8s集群
- k8sv1.26.2集群搭建
- 0. 适用版本
- 1. 集群架构
- 2. 机器初始化
- 3. 安装containerd
- 4. 配置k8s镜像仓库
- 5. 安装k8s核心工具
- 6. 初始化主节点
- 7. node节点加入集群
- 8. 安装Pod网络插件
- 9. 测试k8s集群
- k8sDashboard安装
- k8s安装KubeSphere
- 1. 前提条件
- 2. 安装KubeSphere
- k8s常用命令