Jenkins and Kubernetes CLI plugin and GKE I'm trying to use Jenkins Kubernetes CLI plugin from https://plugins.jenkins.io/kubernetes-cli/ to let deploy artifacts from Jenkins to GKE cluster.
Expected Behavior
Get cluster info on kubectl cluster-info
Actual Behavior
Error out as Unable to connect to the server: x509: certificate signed by unknown authority
Steps to Reproduce the Problem
Output of generated ./kube/config
+ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://xxx.xxx.xxx.yyy
  name: my-cluster
contexts:
- context:
    cluster: my-cluster
    user: jenkins-pipeline
  name: my-cluster-jenkins
current-context: my-cluster-jenkins
kind: Config
preferences: {}
users:
- name: jenkins-pipeline
  user:
    username: jenkins-pipelin

When I run from a command line I need to do
export GOOGLE_APPLICATION_CREDENTIALS=path/to/key.json
Where that part goes in that plugin?
Put it inside the sh?
withKubeConfig(...) {
  sh “””
    export ...
    kubectl ...
  “””
}