k8s in action实践笔记

k9s: unable to locate k8s cluste

2021-05-29  本文已影响0人  众神开挂

ubuntu系统输入k9s后报错提示 unable to locate k8s cluster configuration


报错

解决方法
第一步 先确认 kubectl config文件配置正常

kubectl get nodes

第二步 添加环境变量
临时方法;

export KUBECONFIG=$HOME/.kube/config

想永久生效的话,编辑profile文件

# sudo vi /etc/profile
export KUBECONFIG=$HOME/.kube/config

要让刚才的修改马上生效,需要执行以下代码

source /etc/profile
上一篇 下一篇

猜你喜欢

热点阅读