GoogleCloudPlatform / anthos-service-mesh-packages

Packaged configuration for setting up a Kubernetes cluster with Anthos Service Mesh features enabled
https://cloud.google.com/anthos/service-mesh
Apache License 2.0
134 stars 169 forks source link

gkehub.googleapis.com not enabled; WARNING]: Cluster is registered in the project null #540

Open murphye opened 3 years ago

murphye commented 3 years ago

I am running

bash ./install_asm \
--project_id ABC123  \
--cluster_name ABC123  \
--cluster_location us-central1-c \
--mode install \
--enable_all \
--enable_registration \
--ca citadel \
--verbose

Getting this error, and it says WARNING]: Cluster is registered in the project null, which is not correct.

API [gkehub.googleapis.com] not enabled on project [770406736630]. 
Would you like to enable and retry (this will take a few minutes)? 
(y/N)?  y

Enabling service [gkehub.googleapis.com] on project [770406736630]...
ERROR: (gcloud.container.hub.memberships.list) PERMISSION_DENIED: The caller does not have permission
install_asm: [WARNING]: Cluster is registered in the project null, but the script is
unable to verify in the project. The script will continue to execute.
jasonwzm commented 3 years ago

Is your cluster registered in a different project other than ABC123?

murphye commented 3 years ago

Yes, I just replaced with ABC123 I didn't want to put my real info.

zerobfd commented 3 years ago

I think the question was: "is the cluster registered to an environ with a parent project that is different from the project that the cluster belongs to?" e.g. the cluster is ABC123/us-central1-c/ABC123 but it's registered to an environ in XYZ123.

murphye commented 3 years ago

There are no parent projects. I was unaware that was possible. There is a parent organization however.

murphye commented 3 years ago

API [gkehub.googleapis.com] not enabled on project [770406736630].

I just looked, and none of my projects (or organization) are of ID 770406736630. I have no idea where that came from.

jasonwzm commented 3 years ago

Was this cluster ever registered to an environ before? Is there any custom resource in the output when you do kubectl get memberships.hub.gke.io?

zerobfd commented 3 years ago

I agree the terminology is confusing. This might help: https://cloud.google.com/anthos/multicluster-management/environs#environ-host-project

Short version: you can register clusters from any project to an environ, but the environ itself is only associated with one project.

Also, the number might be a project number and not a project ID: you can check here https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects to see how to check.