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