0

When i try to run gcloud container clusters get-credentials <CLUSTER_NAME> --region <REGION> --project <PROJECT_NAME> through the jenkins pipeline, I get the following error: ERROR:

(gcloud.container.clusters.get-credentials) environment variable HOME or KUBECONFIG must be set to store credentials for kubectl

The same exact command works totally fine when i run it on the jenkins instance terminal. The Kubeconfig path looks fine on the jenkins instance terminal, but when i run it on the pipeline in sh block, it's failing. Need help debugging the issue.

User jenkins pipeline is running as: root As root user, i'm able to run all these commands seamlessly on the jenkins instance terminal

Manually created the .kube/config file, and it has RW permissions for root user and jenkins user as well. Works totally fine when i run it manually on the instance terminal. But when i run the gcloud container clusters ... through jenkins sh , error is thrown.

Need to know how to further debug the issue

0 Answers0