GoogleCloudPlatform / microservices-demo

Sample cloud-first application with 10 microservices showcasing Kubernetes, Istio, and gRPC.
https://cymbal-shops.retail.cymbal.dev
Apache License 2.0
16.77k stars 7.17k forks source link

Terraform Provisioning: error: The gcp auth plugin has been removed. #1445

Closed scottford-io closed 1 year ago

scottford-io commented 1 year ago

Describe the bug

Provisioning the microservices demo with Terraform produces the following error:

│ Error running command 'kubectl apply -k ../kustomize/': exit status 1. Output: + kubectl apply -k ../kustomize/
│ error: The gcp auth plugin has been removed.
│ Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead.
│ See https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke for further details

This happens when the null_resource is executed to deploy to the cluster ...

https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/terraform/main.tf#L73-L83

I was able to get around this with the following:

export USE_GKE_GCLOUD_AUTH_PLUGIN=True
gcloud container clusters get-credentials <cluster_name> --zone <some>
kubectl apply -k ../kustomize/

After getting this working manually, I was able to run terraform apply without any issues. More information can be found here:

https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke

To Reproduce

  1. Clone the repo
  2. cd terraform
  3. create terraform.tfvars
  4. Run terraform init
  5. Run terraform apply -auto-approve
  6. See error

Environment

MacOS Ventura

Kubernetes environment via cnquery

cnquery> k8s.serverVersion
k8s.serverVersion: {
  buildDate: "2022-10-26T09:25:34Z"
  compiler: "gc"
  gitCommit: "e35c4457f66187eff006dda6d2c0fe12144ef2ec"
  gitTreeState: "clean"
  gitVersion: "v1.24.7-gke.900"
  goVersion: "go1.18.7b7"
  major: "1"
  minor: "24"
  platform: "linux/amd64"
}
NimJay commented 1 year ago

@scottford-io, thanks so much for reporting this clear and detailed GitHub issue (and for including the steps you took to get things working). Anyone else that encounters this issue will find your report useful.

I am going to de-prioritize this issue because:

  1. The error message is actionable and informative (e.g., Please use the "gke-gcloud-auth-plugin" ... Go to https://cloud.goo...).
  2. The issue seems specific to the gcloud command-line tool. I do not think there's anything Online Boutique (github.com/GoogleCloudPlatform/microservices-demo) can do to address this issue — other than updating documentation.
minherz commented 1 year ago

@NimJay if you do not see it as an issue, I recommend to close it with the resolution from your previous comment