Skip to content

Installing latest Helm version hits API rate limit after 60 executions #426

@lukerogers

Description

@lukerogers

We use a hosted agent for Helm deployments to speed up the process and if we are deploying a lot of services we hit the rate limit when the task is trying to get the latest stable version.

Downloading: https://api.github.com/repos/helm/helm/releases
##[warning]Cannot get the latest Helm info from https://api.github.com/repos/helm/helm/releases. Error Error: Unexpected HTTP response: 403

In the code located at common-npm-packages/kubernetes-common/helmutility.ts it is loading the full list of releases on each run if a version is not specified, meaning get the latest version. If that request is rate limited and returns a 403 it will fall back to the old version 3.1.2 from March 2020 which is missing functionality and breaks pipelines.

This issue was reported in microsoft/azure-pipelines-tasks#17569 with the "fix" to install it on the machine and skip the helm installer. This is inflexible and requires regular updates.

I think at the least a more recent version number should be the fallback. The use of the newer https://get.helm.sh/helm-latest-version endpoint to get the latest version could work too since it's hitting a storage account, but I don't know if they post RC versions there or not.

I am using the following workaround to hopefully prevent rate limit issues:

- bash: |
    url="https://get.helm.sh/helm-latest-version"
    version=$(curl -s $url | sed 's/^v//')
    echo "Latest Helm Version: $version"
    echo "##vso[task.setvariable variable=HELM_VERSION]$version"
  displayName: 'Get latest version of Helm'

- task: HelmInstaller@1
  displayName: 'Install Helm'
  inputs: 
    helmVersionToInstall: $(HELM_VERSION)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions