title: "server could not find the requested resource (get pods)" error when deploying Helm chart using Jenkins
body: <p>I am trying to deploy my Kubernetes Helm chart for sample Kubernetes cluster deployment. I created a sample Helm chart and added Docker image reference and deployed the Helm chart using terminal command <code>helm install &lt;my-chartname&gt;</code>. And micro service is accessing successfully without any problem.</p>
  
  <p>After that I created a Jenkins pipeline job and added only one stage that containing the step for deployment. I added like the following way,</p>
  
  <pre><code>pipeline 
  {
      agent any
      stages 
          {
              stage ('helmchartinstall')
                  {
                      steps
                      {
                          sh 'helm install spacestudychart'
                      }
                  }
          }       
  }
  </code></pre>
  
  <p>And I am getting the error like following ,</p>
  
  <pre><code>[Pipeline] { (helmchartinstall)
  [Pipeline] sh
  + helm install spacestudychart
  Error: the server could not find the requested resource (get pods)
  </code></pre>
  
  <p>The same command is working when I am running through terminal. </p>
  
  <p><strong>Update</strong></p>
  
  <p>To upgrade tiller to latest version, I run the <code>helm init --upgrade</code> command on terminal. But the error remains still.</p>
  
  <p><strong>Output of "helm version" is like the following,</strong></p>
  
  <pre><code>Client: &amp;version.Version{SemVer:"v2.14.0", GitCommit:"05811b84a3f93603dd6c2fcfe57944dfa7ab7fd0", GitTreeState:"clean"}
  Server: &amp;version.Version{SemVer:"v2.14.0", GitCommit:"05811b84a3f93603dd6c2fcfe57944dfa7ab7fd0", GitTreeState:"clean"}
  </code></pre>
  
  <p><strong>Output of "kubectl version --short" is like the following,</strong></p>
  
  <pre><code>Client Version: v1.14.1
  Server Version: v1.13.5
  </code></pre>
  
  <p>When I run command "kubectl --v=5 get pods; helm install spacestudychart" , I am getting the console output like the following,</p>
  
  <pre><code>+ kubectl --v=5 get pods
  I0604 07:44:46.035459    2620 cached_discovery.go:121] skipped caching discovery info due to yaml: line 10: mapping values are not allowed in this context
  I0604 07:44:46.152770    2620 cached_discovery.go:121] skipped caching discovery info due to yaml: line 10: mapping values are not allowed in this context
  I0604 07:44:46.152819    2620 shortcut.go:89] Error loading discovery information: yaml: line 10: mapping values are not allowed in this context
  I0604 07:44:46.283598    2620 cached_discovery.go:121] skipped caching discovery info due to yaml: line 10: mapping values are not allowed in this context
  I0604 07:44:46.374088    2620 cached_discovery.go:121] skipped caching discovery info due to yaml: line 10: mapping values are not allowed in this context
  I0604 07:44:46.467938    2620 cached_discovery.go:121] skipped caching discovery info due to yaml: line 10: mapping values are not allowed in this context
  F0604 07:44:46.468122    2620 helpers.go:114] error: yaml: line 10: mapping values are not allowed in this context
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 255
  Finished: FAILURE
  </code></pre>
  
  <p>Do I need to upgrade the kubectl version? What is the exact problem when running with Jenkins?</p>