记一次k8s报错:
运行kubectl get pods提示
The connection to the server localhost:8080 was refused - did you specify the right host or port?
查看日志发现时kube-apiserver连不上。
curl localhost:8080/api也失败
命令查看
systemctl status kube-apiserver
发现kube-apiserver未起来,报code=exited, status=255。
执行
sudo cat /var/log/messages | grep kube-apiserver
查看日志,
Failed to list *rbac.RoleBinding: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:2379: getsockopt: connection refused
我去,etcd没起
systemctl status etcd
发现etcd没启动
于是重新走一遍命令