title: How to setup kubectl within jenkins
body: <p>I have my jenkins running on EC2 and installed kubectl. I've also configured kubectl to communicate with my EKS cluster in AWS. </p>
  
  <p>Now, I'm trying to automate the deployment of our application to EKS using Jenkins pipeline. But when jenkins reaches this code below </p>
  
  <pre><code>sh "kubectl apply -f platform_api_deployment.yml"
  </code></pre>
  
  <p>It's showing me this error</p>
  
  <pre><code>/var/lib/jenkins/workspace/platform-api-pipeline/kubernetes@tmp    
  /durable-2696d974/script.sh: line 1: kubectl: command not found
  </code></pre>
  
  <p>I've tried deploying it manually and it works fine.</p>