debben / vsts-helm-extension

An unofficial Helm extension for Visual Studio Team Services
MIT License
4 stars 1 forks source link

helm install fails with "argument: chart name" required #3

Open uday31in opened 6 years ago

uday31in commented 6 years ago

2017-11-23T23:19:25.9436650Z Downloading: https://storage.googleapis.com/kubernetes-helm/helm-v2.7.0-linux-amd64.tar.gz 2017-11-23T23:19:26.0148510Z Extracting archive 2017-11-23T23:19:26.2575260Z [command]/bin/tar xzC /opt/vsts/work/_temp/3fddd964-6258-48de-9942-6614250bb795 -f /opt/vsts/work/_temp/ee07385e-24f8-4050-af65-edda7d5df01d 2017-11-23T23:19:26.3354610Z Caching tool: helm 2.7.0 x64 2017-11-23T23:19:26.6475030Z Found tool in cache: helm 2.7.0 x64 2017-11-23T23:19:26.8874770Z [command]/opt/vsts/work/_tool/helm/2.7.0/x64/helm install --name 24 2017-11-23T23:19:27.0812740Z Error: This command needs 1 argument: chart name 2017-11-23T23:19:27.1675360Z ##[error]Error: This command needs 1 argument: chart name 2017-11-23T23:19:27.2667790Z ##[error]/opt/vsts/work/_tool/helm/2.7.0/x64/helm failed with return code: 1 2017-11-23T23:19:27.3367630Z ##[section]Finishing: helm install

debben commented 6 years ago

Can you show me how you have the task configured? This looks like a Helm issue rather than an issue with the extension.

jldeen commented 6 years ago

Jumping in here, I'm having the same issue. I'm sure it's because I'm trying to use the --name as an argument to pull from the public kubeapps repo, but I don't see a way in your documentation to pass the name of the public chart (stable/jenkins for example) to the helm tool.

debben commented 6 years ago

@jldeen, I'll add something to the documentation. The task pretty much runs "helm \<Command> \<Arguments>". I think setting up the task to use the "install" command with just the arguments "stable/jenkins" should work. The --name parameter for the helm install command just lets you specify a name for the release but this argument alone isn't enough to specify the chart. To install Jenkins with specific release name, you could use the install command but with arguments "--name leeroy stable/jenkins".

It's worth noting too that if you're building a release plan with this task, it might be better to use the "upgrade" command instead of install. When using install, the release plan will run and setup an instance of the chart the first time, but would fail on subsequent releases since there already is a chart with that name installed. It's preferable when creating a VSTS release definition using this task to use the upgrade command with an argument section that looks something like:

$(Release_Name) stable/jenkins -i --version $(Chart_Version)

where Release_Name and Chart_Name are variables in the Release definition. The -i tels helm to install the chart rather than upgrade if it doesn't already exist in the cluster.

jldeen commented 6 years ago

@debben Thank you! I'll also reach out to you offline. I'm publishing a big blog post on K8s and Helm deployment with VSTS using your plugin on Tuesday. I'd love to connect with you further about future updates. (PS. The blog post is already suggesting the helm upgrade command... I was more curious for testing purposes on how to use the plugin with public kubeapps repo arguments. :)