只是记录一下在学习k8s集群搭建过程中遇到的错误

目录

1、pip安装错误

2、SSH连接失败

3、配置IP6

4、虚拟机用户重命名后SSH登录失败

5、node "node1" not found

6、harbor中https

 7、docker搜不到xxx

 8、mandatory.yaml问题

9、java mvn安装

10、ingress-nginx


1、pip安装错误

错误提示:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-y9v41enz/cryptography/

解决方案:
pip3 install --upgrade pip

2、SSH连接失败

错误提示:

Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips

步骤4icon-default.png?t=LA92https://mp.csdn.net/mp_blog/creation/editor/121649136

3、配置IP6

错误提示:
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: 没有那个文件或目录
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: 没有那个文件或目录


解决方案:
执行命令: modprobe br_netfilter

4、虚拟机用户重命名后SSH登录失败

错误提示:
It is also possible that a host key has just been changed.

解决方案:
执行命令: rm ~/.ssh/known_hosts,重新登录ssh

5、node "node1" not found

错误提示:
kubelet.go:2243] node "node4" not found

解决方案:
执行命令 vi /etc/hosts, 查看hostname配置是否错误
重启kubelet: systemctl restart kubelet
查看kubelet状态: systemctl status kubelet

6、harbor中https

错误提示:
prepare base dir is set to /root/harbor
ERROR:root:Error: The protocol is https but attribute ssl_cert is not set

解决方案:
执行命令:vi harbor.yml
注释 https中的内容

 7、docker搜不到xxx

错误提示:
Error response from daemon: No such container: harbornginx

解决方案:
改用中国的镜像仓库

执行命令:cd /etc/docker 然后ls查看目录下有无daemon.json文件,如果没有创建一个

编辑内容:
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
退出保存,重启docker:service docker restart

 8、mandatory.yaml问题

错误提示:
error: unable to recognize "mandatory.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

解决方案:
修改yaml文件:
改前:

apiVersion: extensions/v1beta1
kind: Deployment

改后:

apiVersion: apps/v1
kind: Deployment

------------------------------------------------------
错误提示:
Warning  FailedScheduling  12h   default-scheduler  0/2 nodes are available: 2 node(s) didn't match Pod's node affinity.


解决方案:
搜索mandatory.yaml文件: Deployment中使用了nodeSelector,
nodeSelector:
  app: ingress

需要给工作节点增加打tag:kubectl label node node01 app=ingress

9、java mvn安装

错误提示:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE


解决方案:
可能很多人都是只安装了前面一段,没有安装openjdk-devel导致。
yum -y install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64

10、ingress-nginx

错误提示:
networkPlugin cni failed to set up pod \"default-http-backend-6b849d7877-thl7j_ingress-nginx\" network: could not initialize etcdv3 client: open /etc/kubernetes/pki/etcd/server.crt: no such file or

解决方案:
node节点缺少etcd文件
scp -r /etc/kubernetes/pki/etcd root@node01:/etc/kubernetes/pki/etcd
scp -r /etc/kubernetes/pki/etcd root@node02:/etc/kubernetes/pki/etcd

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐