Skip to content

When the latest gcloud and kubectl, helm cluster authorization sporadically fails #2249

Closed

Description

@natetarrh

With the Google Cloud SDK 150.0.0 release, kubectl is configured to use the credentials of the active gcloud account instead of application default credentials. Under the hood, every kubectl command generates a short-lived access token.

As a result, when a kubectl command hasn't been run for some time, and a helm command is run, the helm command fails with e.g.

Error: Get https://<REDACTED>/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: error executing access token command "/google-cloud-sdk/bin/gcloud ": exit status 2

This can be resolved by running a kubectl command to generate a short-lived access token, and then running the desired helm command.

Helm should generate a short-lived auth token on its own.

Looks like #2237 is a potential duplicate.

Activity

  1. kuroneko25 commented on Apr 10, 2017

    @kuroneko25

    This may be useful kubernetes/kubernetes#30617 as a reference

  2. thomastaylor312 commented on Apr 11, 2017

    @thomastaylor312
    Contributor

    Thanks for the link @kuroneko25, there are some possible good workarounds there.

    I am going to tag this as a bug for now.

  3. hvalle commented on Apr 18, 2017

    @hvalle

    Try any of the following, they worked for me:

    gcloud config set container/use_application_default_credentials true
    or
    export CLOUDSDK_CONTAINER_USE_APPLICATION_DEFAULT_CREDENTIALS=true

    You can read on the 150.0.0 release notes for more info.

    Hope it helps :)

  4. devops1337 commented on Apr 30, 2017

    @devops1337

    @hvalle's instructions didn't work for me

  5. bacongobbler commented on Oct 31, 2017

    @bacongobbler
    Member

    can anyone bump this thread and let us know if this is still relevant for k8s 1.8/helm 2.7? I haven't seen any activity on this issue since April and Google Cloud SDK's now at 177.0.0.

  6. bacongobbler commented on Oct 31, 2017

    @bacongobbler
    Member

    closed as resolved in #2277.

  7. Davidrjx commented on May 23, 2019

    @Davidrjx

    #2277 seems not works as it can not extend expire validly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions