Azure-pipelines-tasks: Helm package & deploy task. Cannot run helm init --client-only without cluster information

Created on 14 Sep 2018  路  8Comments  路  Source: microsoft/azure-pipelines-tasks

If you add a Helm package & deploy task, cluster information is required to save the task.
When using Azure Resource Manager, an Azure subscription, resource group, and cluster name are required, or a Kubernetes service endpoint must be configured.

If I want to run helm init --client-only I can't do this with the task unless I have a cluster

This makes sense as part of a release but not as part of a build. It could also lead to broken builds if clusters are changed.

It would be good to either add a client only checkbox, or add 'init --client-only' as a standalone command that doesn't require cluster information.

As a workaround I'm currently running the command via the command line script task instead

Release enhancement

Most helpful comment

@rh072005 if you're using a HelmInstaller task before executing your HelmDeploy task, the recent update (hotfixed yesterday) to the HelmInstaller task will do helm init --client-only for you, as a part of verifying the installation.

All 8 comments

@rh072005 We will fix this. Thanks for the feedback. For other commands like package we made the change but missed out on this. Let me know if you have any other feedback on the container - K8s features in Azure DevOps.

@rh072005 if you're using a HelmInstaller task before executing your HelmDeploy task, the recent update (hotfixed yesterday) to the HelmInstaller task will do helm init --client-only for you, as a part of verifying the installation.

@rh072005 you can choose connection type as None and pass --client-only as an argument to init command for HelmDeploy task.
helm_client_only

This issue was never fixed? The merge request was never completed. Please re-open and provide a mechanism to package without requiring a cluster

@AdamClarkRock am I missing something? Package doesn't need a running cluster.
image

Hey @ds-ms - Thanks for the response, it's probably me missing something. I revisited the options in the helm build pipeline tasks and was able to get it working, I've pasted the yaml below on the off chance it helps anyone else:

- task: HelmDeploy@0
  inputs:
    connectionType: 'None'
    command: 'init'
    upgradeTiller: false
    arguments: '--client-only'

- task: HelmDeploy@0
  inputs:
    connectionType: 'None'
    command: 'package'
    chartPath: 'deploy/helm/client'
    chartVersion: '1.0.0'

The init is required before the package

That's correct.
helm init --client-only is required for you to initialize the repositories locally.
If you're using Hosted Ubuntu 1604 pool you won't be needing to init explicitly once this fix is rolled out: https://github.com/microsoft/azure-pipelines-image-generation/pull/976

Nice, thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings