Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55544

kubernetes-plugin creates blank kubeconfig

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • kubernetes-cli-plugin
    • Jenkins 2.156
      Kubernetes-cli 1.4.0
      Kubernetes-credentials 0.4.0

      I setup a kubernetes credentials with raw content:

      When I use it referring only with the credentials-id as follows:

      steps {
       withKubeConfig([credentialsId: 'kubernetes-mkp-int' ,
       ]) {
       sh 'kubectl get pods'
       sh 'helm get mkp-int --tiller-namespace mkp-int'
       }
       }

       

       

      It fails:

       

      {[Pipeline] withKubeConfig$ kubectl config set-cluster k8s --server=null --insecure-skip-tls-verify=true Cluster "k8s" set.
      [Pipeline] // withKubeConfig[Pipeline] }
      [Pipeline] // withEnv[Pipeline] }
      [Pipeline] // node
      [Pipeline] }[Pipeline] // stage[Pipeline] }
      [Pipeline] // withEnv[Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node[Pipeline] End of PipelineERROR: Unsupported Credentials type com.microsoft.jenkins.kubernetes.credentials.KubeconfigCredentials
      Finished: FAILURE

       

       

      In the workspace, a kubeconfig file has been created but it has nothing in common with my credentials defined.

       

      cat .kube6838469646141525001config
      apiVersion: v1
      clusters:
      - cluster:
      insecure-skip-tls-verify: true
      server: "null"
      name: k8s
      contexts: []
      current-context: ""
      kind: Config
      preferences: {}
      users: []

       

      I have one kubernetes credentials added and I have been tested that changing the 

      I'm doing something wrong or it's a bug?

       

            max_laverse Max Laverse
            rubick Ruben Fernandez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: