Unable to connect to the server: x509: certificate signed by unknown authority

版权声明: https://blog.csdn.net/qq_37143673/article/details/88105373
unable to recognize "csis-service.yaml": Get https://xx.xx.xxx.xxx:xxxx/api?timeout=32s: x509: 
certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
unable to recognize "csis-service.yaml": Get https://xx.xx.xxx.xxx:xxxx/api?timeout=32s: x509: 
certificate signed by unknown authority (possibly because of "crypto/rsa: 
verification error" while trying to verify candidate authority certificate "kubernetes")
Unable to connect to the server: x509: certificate signed by unknown authority 
(possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

原因:

我这是通过 gitlab-runner 来运行打包项目
gitlab-runner 用户在执行时由于 k8s 授权异常报错

解决方法:

切换 gitlab-runner 用户把 k8s 授权文件放进去

#找到授权文件
cd ~
ls -a
#可以看到有个叫 .kube 的文件夹,一整个下载下来
#切换 gitlab-runner 用户
su gitlab-runner
cd ~
#然后上传刚的 .kube 文件夹,整个解压
#验证授权成功
kubectl get node

猜你喜欢

转载自blog.csdn.net/qq_37143673/article/details/88105373