k8s搭建过程常见错误

open /etc/kubernetes/ssl/kubernetes.pem: no such file or directory

 

将/usr/lib/systemd/system/etcd.service中配秘钥的部分删除

 

listen tcp 127.0.0.1:2379: bind: address already in use

/etc/etcd/etcd.conf 127.0.0.1:2379不修改

 

 

publish error: etcdserver: request timed out

 

因为etcd1的配置文件/etc/etcd/etcd.conf中的ETCD_INITIAL_CLUSTER_STATE是new,而在配置中ETCD_INITIAL_CLUSTER写入了etcd2/3的IP:PORT,这时etcd1尝试去连接etcd2、etcd3,但是etcd2、3的etcd服务此时还未启动,因此需要先启动etcd2和3的etcd服务,再去启动etcd1。

 

 

health check for peer 2b72f648e4267cd7 could not connect: dial tcp 192.168.30.147:2380: i/o timeout

 

防火墙没有关闭

 

 

The connection to the server localhost:8080 was refused - did you specify the right host or port?

解决方法:

需要开启api server 代理端口:

查看端口是否代理:curl localhost:8080/api

开启端口代理:kubectl proxy --port=8080 &

 

 

details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or

 

安装完成后,执行一下docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

如果依然报错,可参考下面的方案:

 

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm

rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem

 

这两个命令会生成/etc/rhsm/ca/redhat-uep.pem文件.

顺得的话会得到下面的结果。

 

[root@localhost]# docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

Trying to pull repository registry.access.redhat.com/rhel7/pod-infrastructure ...

latest: Pulling from registry.access.redhat.com/rhel7/pod-infrastructure

26e5ed6899db: Pull complete

66dbe984a319: Pull complete

9138e7863e08: Pull complete

Digest: sha256:92d43c37297da3ab187fc2b9e9ebfb243c1110d446c783ae1b989088495db931

Status: Downloaded newer image for registry.access.redhat.com/rhel7/pod-infrastructure:latest

 

删除原来创建的rc

[root@localhost /]# kubectl delete -f mysql-rc.yaml

重新创建

[root@localhost /]# kubectl create -f mysql-rc.yaml

replicationcontroller "mysql" created

再次查看状态

[root@localhost /]# kubectl get pod

NAME READY STATUS RESTARTS AGE

mysql-b8m2q 1/1 Running 0 27m

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值