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

kubernetes-cli-plugin is not working.

XMLWordPrintable

      I have configured kubernetes-cli plugin on my Jenkins to deploy my docker image on Kubernetes cluster.

      But when I run my job, I am getting error as below. Detailed error is attached as error-log.txterror-log.txterror-log.txt.

       
      Caused: java.io.IOException: Cannot run program "kubectl": error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
      at hudson.Proc$LocalProc.<init>(Proc.java:245)
      at hudson.Proc$LocalProc.<init>(Proc.java:214)
       

      Jenkins Pipeline stage:

      node {
      label '****'
      script {
      git (url: 'git@gitlab.****.com:***/kubectl-cli.git', branch: 'master', credentialsId: 'sousr'
      }
      stage('List pods') {
      
      withKubeConfig(
      credentialsId: 'token-g88c9:sklnbp7rktcf4b99vg2vzbh7t66v7rbrp7rk6js6pcv6dmmb5jlr92', 
      serverUrl: 'https://maui1.*****.com/v3') {
      sh 'kubectl get pods' 
      }
      }
      }
      
      

       

            sunilchaurha Sunil Chauraha
            sunilchaurha Sunil Chauraha
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: