Linux下搭建k8s集群时,报错:The connection to the server localhost:8080 was refused

问题描述:

 

安装flannel插件时报错

Linux下搭建k8s集群时,报错:The connection to the server localhost:8080 was refused_第1张图片
 

 

在没有配置config文件时,kube-apiserver默认使用的是localhost,解决方法如下:

 

普通用户执行如下操作:

[k8s@server1 ~]# mkdir -p $HOME/.kube
[k8s@server1 ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[k8s@server1 ~]# sudo chown $(id -u):$(id -g) $HOME/.kube/config

 

你可能感兴趣的:(Linux下搭建k8s集群时,报错:The connection to the server localhost:8080 was refused)