bherto39
bherto39

Reputation: 1806

Running kubectl command in Jenkins using a minikube kubernetes cluster

I have a jenkins on my http://localhost:8080/ and I created a project which will run a kubectl command to connect to a kubernetes cluster using (minikube)

I'm trying to run a windows command C:\Program Files (x86)\Jenkins\workspace\test2>kubectl apply -f .\my-deployment.yaml

Here's the minikube cluster info Kubernetes master is running at https://192.168.99.100:8443

on Jenkins my build environment is like here's my kubernetes kubectl config in Jenkins

Is there a default credential when connecting to minikube? I used default-admin with no password or admin/admin

I'm getting this error during Jenkins build

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)

Thanks for your answers.

Upvotes: 1

Views: 1693

Answers (1)

Javier Salmeron
Javier Salmeron

Reputation: 8825

Minikube makes use of SSL certificates to connect to the API server. Then you need to use that certificate to properly identify yourself. You can find the information in your .kube/config file.

Upvotes: 1

Related Questions