时间:2023-05-25 16:15:01 | 来源:网站运营
时间:2023-05-25 16:15:01 来源:网站运营
【日记】音乐网站开发第十五天:这几天又没搞那个网站相关的东西# 文档中是 sudo kubeadm init --pod-network-cidr=192.168.0.0/16# 但是跟我的网络冲突了(192.168.1.0/24)所以换成 128.0.0.0/16sudo kubeadm init --pod-network-cidr=128.0.0.0/16
报错。[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.21.1: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)我用屁股想想都知道是墙的问题。
# edit /etc/systemd/system/docker.service.d/http-proxy.conf[Service]Environment="HTTP_PROXY=http://172.20.66.161:1080"Environment="HTTPS_PROXY=http://172.20.66.161:1080"
然后重新加载配置文件,并重启 docker 守护进程sudo systemctl daemon-reloadsudo systemctl restart docker
再次执行 init,过了一会,看到代理上网络利用率逐渐飞高,说明 docker 走代理了,一个字,爽!mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yamlkubectl create -f https://docs.projectcalico.org/manifests/custom-resources.yaml
坐等 Status 变成 Runningwatch kubectl get pods -n calico-system
。。。二十分钟后。。。systemctl status docker# 母的问题systemctl status kubelet# 发现问题
Error validating CNI config list" configList=........它说配置文件有问题,我打开看了看,里面内容看不懂,但是格式确实没问题啊。。。
kubectl delete -f https://docs.projectcalico.org/manifests/tigera-operator.yamlkubectl delete -f https://docs.projectcalico.org/manifests/custom-resources.yaml
再装 Flannelkubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
继续坐等watch kubectl get pods -n kube-system
没一会,都 Running 了# 获取 join 命令kubeadm token create --print-join-command# 我这里得到 kubeadm join 192.168.1.2:6443 --token 4vl3iy.wxuhlgssr2wauigk --discovery-token-ca-cert-hash sha256:13f8d586e877295d5839aa8a12128dc4859c8c660993b10a963d7d94c8ef230c# 在其他三个节点上运行,前面加上 sudosudo kubeadm join 192.168.1.2:6443 --token 4vl3iy.wxuhlgssr2wauigk --discovery-token-ca-cert-hash sha256:13f8d586e877295d5839aa8a12128dc4859c8c660993b10a963d7d94c8ef230c
加进来之后,查看节点状态,那三台 NotReady。过了五分钟,还是 NotReady。关键词:音乐,日记