<p>i am using jenkins kubernetes plugin.Configure it and testing a sample pipeline code as below:</p>
<pre><code>podTemplate(containers: [
        containerTemplate(name: 'ssh-client', image: 'kroniak/ssh-client:3.6', ttyEnabled: true, command: 'cat')
]) {
    node(POD_LABEL) {
        stage('container log') {
            container('ssh-client') {
                sshagent (credentials: ['ContainerExecDecoratorPipelineTest-sshagent']) {
                    sh 'env'
                    sh 'ssh-add -L'
                    sh 'ssh -vT -o &quot;StrictHostKeyChecking=no&quot; git@github.com'
                }
            }
        }
    }
}
</code></pre>
<p>while this is building i can check my kubernetes cluster and noticed that pods are creating but terminating also after few seconds. It keeps happening infinitely. I even checked with all other sample pipelines. The console output in Jenkins shows :</p>
<pre><code>Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] podTemplate
[Pipeline] {
[Pipeline] node
Created Pod: ns-jenkins/tests-14-zm889-hxd6p-j19bl
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Scheduled] Successfully assigned ns-jenkins/tests-14-zm889-hxd6p-j19bl to docker-desktop
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Pulling] Pulling image &quot;kroniak/ssh-client:3.6&quot;
Still waiting to schedule task
‘tests-14-zm889-hxd6p-j19bl’ is offline
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Pulled] Successfully pulled image &quot;kroniak/ssh-client:3.6&quot;
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Created] Created container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Started] Started container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Pulled] Container image &quot;jenkins/inbound-agent:4.3-4&quot; already present on machine
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Created] Created container jnlp
[Normal][ns-jenkins/tests-14-zm889-hxd6p-j19bl][Started] Started container jnlp
Created Pod: ns-jenkins/tests-14-zm889-hxd6p-23hwk
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Scheduled] Successfully assigned ns-jenkins/tests-14-zm889-hxd6p-23hwk to docker-desktop
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Pulled] Container image &quot;kroniak/ssh-client:3.6&quot; already present on machine
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Created] Created container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Started] Started container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Pulled] Container image &quot;jenkins/inbound-agent:4.3-4&quot; already present on machine
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Created] Created container jnlp
[Normal][ns-jenkins/tests-14-zm889-hxd6p-23hwk][Started] Started container jnlp
Created Pod: ns-jenkins/tests-14-zm889-hxd6p-wnxr9
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Scheduled] Successfully assigned ns-jenkins/tests-14-zm889-hxd6p-wnxr9 to docker-desktop
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Pulled] Container image &quot;kroniak/ssh-client:3.6&quot; already present on machine
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Created] Created container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Started] Started container ssh-client
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Pulled] Container image &quot;jenkins/inbound-agent:4.3-4&quot; already present on machine
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Created] Created container jnlp
[Normal][ns-jenkins/tests-14-zm889-hxd6p-wnxr9][Started] Started container jnlp
</code></pre>

<p><code>kubectl logs &lt;jenkins-pod&gt; --namespace=&lt;jenkins-namespace&gt;</code> is a good starting point to start debugging the issue.</p>
<p>When you define your Kubernetes clusters under <code>Manage Jenkins -&gt; Configure System -&gt; Cloud -&gt; Kubernetes Cloud Details</code>, does the Jenkins URL match the Endpoint address in <code>kubectl describe service jenkins</code>?</p>
<p>The Endpoint address must match the Jenkins URL in the Kubernetes Cloud Details</p>
<pre><code>kubectl describe service jenkins -n jenkins | grep Endpoint
Endpoints: 192.168.151.57:8080
</code></pre>
