<p>I'm using pipelines in Jenkins that are running using JNLP container instead of my container.</p>
<p>I'm using Jenkins as a code (Jenkin Helm chart)</p>
<p>If I add this block to the pipeline -</p>
<pre><code> container('my container') {
}
</code></pre>
<p>It is using 'my container'.</p>
<p>How do I set it as default to all my pipelines? Do I really need to add this container block all the time?</p>

EilonA
<p>As mentioned in <a href="https://plugins.jenkins.io/kubernetes/" rel="nofollow noreferrer">kubernetes plugin doc</a> you can change it globally with following code:</p>
<pre><code>pipeline {
  agent {
    kubernetes {
      defaultContainer 'maven'
      yamlFile 'KubernetesPod.yaml'
    }
  }

  stages {
    stage('Run maven') {
      steps {
        sh 'mvn -version'
      }
    }
  }
}
</code></pre>
