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

解决CentOS部署K3S环境8080端口异常

首先运行起来systemctl start k3s.service 不然不存在/etc/rancher/k3s/k3s.yaml
运行起来后编辑文件设置
	   vim /etc/profile
	   在底部增加新的环境变量 export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
	   或者是
	   echo "export KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> /etc/profile
使生效
	source /etc/profile

在这里插**加粗样式**入图片描述


版权声明:本文为weixin_42103983原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。