首页 文章

使用minikube kubernetes集群在Jenkins中运行kubectl命令

提问于
浏览
1

我在http://localhost:8080/上有一个jenkins,我创建了一个项目,它将使用kubectl命令连接到kubernetes集群(minikube)

我正在尝试运行Windows命令C:\ Program Files(x86)\ Jenkins \ workspace \ test2> kubectl apply -f . \ my-deployment.yaml

这是minuberube集群信息Kubernetes master在https://192.168.99.100:8443运行

在Jenkins我的构建环境就像
here's my kubernetes kubectl config in Jenkins

连接到minikube时是否有默认凭据?我使用default-admin没有密码或admin / admin

我在Jenkins构建期间遇到此错误

C:\Program Files (x86)\Jenkins\workspace\test2>kubectl apply -f .\my-deployment.yaml 

error: You must be logged in to the server (the server has asked for the client to provide credentials)

谢谢你的回答 .

1 回答

  • 1

    Minikube使用SSL证书连接到API服务器 . 然后,您需要使用该证书来正确识别自己 . 您可以在 .kube/config 文件中找到该信息 .

相关问题