Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Cloud CLI does not install gke-gcloud-auth-plugin #22

Open
nicky-lenaers opened this issue Jun 22, 2023 · 6 comments
Open

Google Cloud CLI does not install gke-gcloud-auth-plugin #22

nicky-lenaers opened this issue Jun 22, 2023 · 6 comments

Comments

@nicky-lenaers
Copy link

I have the following devcontainer.json:

{
  "name": "devcontainer",
  "image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
  "features": {
    "ghcr.io/devcontainers/features/git:1": {
      "version": "2.39.1"
    },
    "ghcr.io/devcontainers-contrib/features/pre-commit:2": {
      "version": "v3.3.3"
    },
    "ghcr.io/devcontainers/features/terraform:1": {
      "version": "1.5.1",
      "tflint": "0.47.0"
    },
    "ghcr.io/devcontainers-contrib/features/infracost:1": {
      "version": "v0.10.22"
    },
    "ghcr.io/devcontainers-contrib/features/kubectl-asdf:2": {
      "version": "1.27.3"
    },
    "ghcr.io/dhoeric/features/google-cloud-cli:1": {
      "version": "436.0.0",
      "installGkeGcloudAuthPlugin": true
    },
    "ghcr.io/devcontainers/features/python:1": {
      "version": "3.10"
    },
    "ghcr.io/devcontainers-contrib/features/poetry:2": {
      "version": "1.4.2"
    }
  },
  "forwardPorts": [4200, 8265, 8000],
  "postCreateCommand": "npm install"
}

As you can see I set installGkeGcloudAuthPlugin to true. Then I execute:

$ gke-gcloud-auth-plugin --version

which yields:

bash: gke-gcloud-auth-plugin: command not found

When installing manually through gcloud components install gke-gcloud-auth-plugin I get:

ERROR: (gcloud.components.install) 
You cannot perform this action because the Google Cloud CLI component manager 
is disabled for this installation. You can run the following command 
to achieve the same result for this installation: 

sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin

And subsequently sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin which yields:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package google-cloud-sdk-gke-gcloud-auth-plugin

Then I also tried "remoteUser": "root" in devcontainer.json but no luck.

@nicky-lenaers nicky-lenaers changed the title Google Cloud does not install gke-gcloud-auth-plugin Google Cloud CLI does not install gke-gcloud-auth-plugin Jun 22, 2023
@pauldowman
Copy link

Same issue for me. But sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin did work for me after doing sudo apt-get update -y

@siyath123
Copy link

``{
"name": "devcontainer",
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
"features": {
"ghcr.io/devcontainers/features/git:1": {
"version": "2.39.1"
},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"version": "v3.3.3"
},
"ghcr.io/devcontainers/features/terraform:1": {
"version": "1.5.1",
"tflint": "0.47.0"
},
"ghcr.io/devcontainers-contrib/features/infracost:1": {
"version": "v0.10.22"
},
"ghcr.io/devcontainers-contrib/features/kubectl-asdf:2": {
"version": "1.27.3"
},
"ghcr.io/dhoeric/features/google-cloud-cli:1": {
"version": "436.0.0",
"installGkeGcloudAuthPlugin": true
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "1.4.2"
}
},
"forwardPorts": [4200, 8265, 8000],
"postCreateCommand": "npm install"
}

@nicky-lenaers
Copy link
Author

@siyath123 Not sure what your comment is supposed to say. Can you elaborate?

@raz-amir
Copy link

Workaround: If you will write INSTALL_GKEGCLOUDAUTH_PLUGIN instead of installGkeGcloudAuthPlugin it will work :)

@drehelis
Copy link

@ramir-savvy suggestion will work,
#21 fix is here, hopefully will get merged soon.

@garnertb
Copy link

garnertb commented Feb 2, 2024

I just ran into this as well, and can confirm this workaround fixed it. @dhoeric, can #21 be merged?

"ghcr.io/dhoeric/features/google-cloud-cli:1": {
      "INSTALL_GKEGCLOUDAUTH_PLUGIN": true
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants