K8s ❉ 报错cannot stat ‘/etc/kubernetes/admin.conf’

现象

        报错提示:cannot stat ‘/etc/kubernetes/admin.conf’: No such file or directory

解决方式:

        从master节点拷贝过来

        

# master节点执行
[root@master ~]# scp /etc/kubernetes/admin.conf root@192.168.247.137:/etc/kubernetes/admin.conf
The authenticity of host '192.168.247.137 (192.168.247.137)' can't be established.
ECDSA key fingerprint is SHA256:oj2gG+nDvkzbS+IggsOxKVwMTVP2zxClBoNEPXmHvzk.
ECDSA key fingerprint is MD5:fa:f6:9a:89:1a:4a:54:63:fe:3d:70:88:c4:a4:4d:ea.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.247.137' (ECDSA) to the list of known hosts.
root@192.168.247.137's password: 
admin.conf                                                                    100% 5451     3.5MB/s   00:00    

# node节点执行
[root@slave2 ~]# echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
[root@slave2 ~]# source ~/.bash_profile
[root@slave2 ~]# chown $(id -u):$(id -g) $HOME/.kube/config

# 验证
[root@slave2 ~]# kubectl get pod
NAME                     READY   STATUS    RESTARTS   AGE
nginx-6867cdf567-vkf99   1/1     Running   0          6m38s

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值