<p>I have added helm as podtemplate in value.yaml file</p>
<pre><code> podTemplates: 
    helm: |
      - name: helm
        label: jenkins-helm
        serviceAccount: jenkins
        containers:
          - name: helm
            image: lachlanevenson/k8s-helm:v3.1.1
            command: &quot;/bin/sh -c&quot;
            args: &quot;cat&quot;
            ttyEnabled: true
            privileged: true
            resourceRequestCpu: &quot;400m&quot;
            resourceRequestMemory: &quot;512Mi&quot;
            resourceLimitCpu: &quot;1&quot;
            resourceLimitMemory: &quot;1024Mi&quot;
</code></pre>
<p>so i want to run helm in pipeline as</p>
<pre><code>     steps {
            container('helm') {
                sh &quot;helm upgrade --install --force  ./helm&quot;
            }
        }
</code></pre>
<p>but i got error</p>
<pre><code>       /home/jenkins/workspace/coverwhale@tmp/durable-4d1fbfd5/script.sh: 1: /home/jenkins/workspace/coverwhale@tmp/durable-4d1fbfd5/script.sh: helm: not found
</code></pre>
<p><strong>Version of Helm and Kubernetes</strong>:</p>
<p>Helm Version:</p>
<pre><code>$ helm version
version.BuildInfo{Version:&quot;v3.5.2&quot;, GitCommit:&quot;167aac70832d3a384f65f9745335e9fb40169dc2&quot;, GitTreeState:&quot;dirty&quot;, GoVersion:&quot;go1.15.7&quot;}

</code></pre>
<p>Kubernetes Version:</p>
<pre><code>$ kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.2&quot;, GitCommit:&quot;faecb196815e248d3ecfb03c680a4507229c2a56&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-01-13T13:28:09Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.2&quot;, GitCommit:&quot;faecb196815e248d3ecfb03c680a4507229c2a56&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-01-13T13:20:00Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}

</code></pre>
<p><strong>Which version of the chart</strong>:</p>
<p><strong>What happened</strong>:
/home/jenkins/workspace/coverwhale@tmp/durable-4d1fbfd5/script.sh: 1: /home/jenkins/workspace/coverwhale@tmp/durable-4d1fbfd5/script.sh: helm: not found</p>
<p><strong>What you expected to happen</strong>:
run helm chart</p>

<p>pipeline code</p>
<pre><code>pipeline {

agent any

stages {

         stage('Initialize Docker'){
             steps {
                  script {
                       def docker = tool 'whaledocker'
                       echo &quot;${docker}&quot;
                       echo &quot;${env.PATH}&quot;
                       env.PATH = &quot;${docker}/bin:${env.PATH}&quot;
                       echo &quot;${env.PATH}&quot;
                  }
             }
        }
    
        stage('Checkout Source') {

             steps {
                 git url:'https://github.com/alialrabi/laravel-example.git', branch: 'uat', credentialsId: 'github'
             }
        }

        stage(&quot;Build image&quot;) {
      
            steps {
                 script {
                   myapp = docker.build(&quot;alialrabi/coverwhale:${env.BUILD_ID}&quot;)
                 }
            }
        }
    
 
        stage(&quot;Run Test&quot;) {
      
            steps {
                 script {
                      docker.image(&quot;alialrabi/coverwhale:${env.BUILD_ID}&quot;).inside {
                     //   sh 'composer install'  
                      //  sh 'php artisan test'
                      }
                 }
            }
        }
    

        stage(&quot;Push image&quot;) {
        
             steps {
                
                 script {
                     docker.withRegistry('https://registry.hub.docker.com', 'dockerhub') {
                          myapp.push(&quot;latest&quot;)
                          myapp.push(&quot;${env.BUILD_ID}&quot;)
                     }
                 }
             }
        }

        stage('Deploy Uat') {
            
 
            steps {
                 script {
                echo &quot;Done Uat&quot;
                  sh &quot;helm upgrade --install --force&quot;
             }
            }
        }
 }
}
</code></pre>

<p>I have solved it by add containerTemplate to agent.</p>
<pre><code>  stage('Deploy dev') {
            
         agent {
           kubernetes {
                 containerTemplate {
                   name 'helm'
                   image 'lachlanevenson/k8s-helm:v3.1.1'
                   ttyEnabled true
                   command 'cat'
              }
            }
         }
            
            steps {
               container('helm') { 
                 sh &quot;helm upgrade full-cover ./helm&quot;
               }    
             }
        } 
</code></pre>
