While trying to add a node in gke cluster facing error
Error message is
All clusters resources are brought up:but only 0 nodes out of 10 have registered
How to fix this error
As per this official doc this error message demonstrates that the nodes did not successfully register with the cluster.
The following sections describe some of the potential causes of this error:
Using the below log filter you need to Find an instance that failed node registration :
resource.type="gce_instance" logName="projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity" protoPayload.requestMetadata.callerSuppliedUserAgent="GCE Managed Instance Group for GKE" protoPayload.response.status="RUNNING" Replace PROJECT_ID with the project ID for your cluster.
Follow this troubleshooting doc for step by step process to Find an instance that failed node registration and follow this Troubleshoot an instance with the Node Registration Checker to check the reason. Based on the reason you get follow below docs to resolve this issue.
If LOGGING, GCR, or GCS are listed as not reachable, check the Service account permissions for node registration and Network connection to Google APIs and services for node registration.
If Master is listed as not reachable, check the prerequisites for Network connection with control plane for node registration.
After you resolve all issues preventing successful node registration, refer to Complete node registration after fixing the root cause.
If the preceding steps don't tell you why node registration failed, refer to Gather information for further investigation.