Azure Heml Init task fail to find kubectl

11/14/2019

Over the night all our builds and releases pipelines failed due to introducing the new Helm Install task or 3.0 Helm release. We manage to fix Helm install by using the *1 version in preview and install last working helm which was 2.16.0. After that our task Heml Init failed because it cannot find the kubectl. Yesterday everything was working fine. This is happening across our all builds and releases. Directory in which it trying to find kubectl is empty for some reason. Did something changed over the night?

Log:

2019-11-14T10:22:21.1487212Z ##[debug]Kubeconfig file path: C:\agent\_work\_temp\helmTask\1573726941144\config
2019-11-14T10:22:21.1494250Z ##[debug]which 'kubectl'
2019-11-14T10:22:21.1574073Z ##[debug]not found
2019-11-14T10:22:21.1576552Z ##[debug]task result: Failed
2019-11-14T10:22:21.1634103Z ##[error]Error: Unable to locate executable file: 'kubectl'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2019-11-14T10:22:21.1641140Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Unable to locate executable file: 'kubectl'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2019-11-14T10:22:21.1642296Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Unable to locate executable file: 'kubectl'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.```
-- kjubersson
azure-devops
azure-pipelines
kubernetes-helm

1 Answer

11/20/2019

The solution was to add checkLatestHemlVersion to false:

- task: HelmInstaller@0
   displayName: 'Install Helm 2.16.1'
   inputs:
     helmVersion: 2.16.1
     checkLatestHelmVersion: false
-- kjubersson
Source: StackOverflow