title: Pods terminated immediately from Jenkins to Kubernetes cluster
body: <p>I have jenkins running on Windows as a service on 127.0.0.1:8080<br />
  and minikube running on 192.168.99.101<br />
  below is the pipeline for Jenkins job</p>
  <pre><code>podTemplate(
    activeDeadlineSeconds: 240,
    name: 'default',
    inheritFrom: 'default',
    nodeSelector: 'key1=value1,kubernetes.io/hostname=minikube',
    containers: [
    containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat' ),
    containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:3.35-2-alpine', args: '${computer.jnlpmac} ${computer.name}')
  ]) {
  
  node(POD_LABEL) {
      stage('Get a Maven project') {
          git 'https://github.com/&lt;project&gt;.git/'
          container('maven') {
              stage('Build a Maven project') {
                  sh 'mvn -B -gs ./settings.xml clean install'
              }
          }
      }
    }
  }    
  </code></pre>
  <p>The following are the logs for from the kubernetes:</p>
  <pre><code>$ kubectl get -a pods --watch
  Flag --show-all has been deprecated, will be removed in an upcoming release
  NAME                  READY     STATUS    RESTARTS   AGE
  default-7r0n8-b2sxx   0/2       Pending   0          0s
  default-7r0n8-b2sxx   0/2       Pending   0         0s
  default-7r0n8-b2sxx   0/2       ContainerCreating   0         0s
  default-7r0n8-b2sxx   2/2       Running   0         0s
  default-7r0n8-b2sxx   1/2       Error     0         1s
  default-7r0n8-18cv6   0/2       Pending   0         0s
  default-7r0n8-18cv6   0/2       Pending   0         0s
  default-7r0n8-18cv6   0/2       ContainerCreating   0         0s
  default-7r0n8-18cv6   2/2       Running   0         0s
  default-7r0n8-18cv6   1/2       Error     0         2s
  default-7r0n8-0kz80   0/2       Pending   0         0s
  default-7r0n8-0kz80   0/2       Pending   0         0s
  default-7r0n8-0kz80   0/2       ContainerCreating   0         0s
  default-7r0n8-0kz80   2/2       Running   0         0s
  default-7r0n8-0kz80   1/2       Error     0         1s  
  </code></pre>
  <p>The following is the console's output from the jenkins job</p>
  <p><a href="https://i.stack.imgur.com/2EYkv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2EYkv.png" alt="enter image description here" /></a></p>
  <p>The pods are getting killed and recreated each time.</p>
  <p>Please Can anyone help how to resolve this issue?<br />
  Any help would be appreciated.</p>
  <p>pod logs</p>
  <p><a href="https://i.stack.imgur.com/rMceA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rMceA.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/ELyLL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ELyLL.png" alt="enter image description here" /></a></p>