Ariel
Ariel

Reputation: 9

jenkins kubernetes context not found

My groovy pipeline has 3 steps (all with shell):

Now most of the time these jobs run fine with no issues at all. But a few days ago it gave me this error on stage 3:

error: context "..." does not exist

I can't figure out why this failed once, and unfortunately I don't have the full log of that job any more. It's weird, as the context worked for the helm install stage, so how could it be not found all of a sudden?

what do you think can cause this random issue? How can I avoid it in the future?

Upvotes: 0

Views: 1745

Answers (1)

rriovall
rriovall

Reputation: 486

The reason is "..." context does not exist in your kubeconfig file. You can run kubectl config view -o jsonpath='{.current-context}' to check current context and use that context.

As per in this document Set which Kubernetes cluster kubectl communicates with and modifies configuration information.

Upvotes: 1

Related Questions