Search code examples
google-cloud-platformgoogle-kubernetes-engine

How to find control plane IP addresses for a regional GKE cluster


I mistakenly deleted the firewall entry that allows the control plane nodes to establish ssh tunnels to the worker nodes. I need to recreate the firewall entry, but I can't find the IP addresses of the controller nodes.

This is a regional cluster, so the cluster endpoint is a load balancer that sits in front of the 3 control plane IPs. I don't see that load balancer in my GCP console though, so I can't get its details.

How do I find the IP addresses of the 3 control plane nodes in a GKE regional cluster?


Solution

  • There should have been a log created when the rules were deleted. The IP addresses are in there. You can pull them out with something like this:

    gcloud logging read 'resource.type="gce_firewall_rule" AND \
    timestamp>="2020-11-01T00:00:00Z" AND \
    protoPayload.methodName="v1.compute.firewalls.delete" AND \
    protoPayload.resourceName:gke'