Private GKE cluster: a VM in the same VPC subnetwork kubernetes-management has internal IP 192.168.40.2/24 and no external IP. You need kubectl access to the cluster master. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Add 192.168.40.0/24 to masterAuthorizedNetworksConfig and point kubectl to 192.168.38.2..
Why this is the answer
The correct option allows the VM to connect to the GKE control plane. Private GKE clusters have a private endpoint for the control plane (192.168.38.2 in this case) that is only accessible from within the cluster's VPC network or authorized networks. masterAuthorizedNetworksConfig specifies which CIDR blocks are allowed to access the control plane endpoint. Since the VM is in the 192.168.40.0/24 subnet, adding this range to masterAuthorizedNetworksConfig enables connectivity. Pointing kubectl to 192.168.38.2 directs it to the private control plane endpoint. The other options are incorrect because: Adding 192.168.38.0/28 or 192.168.36.0/24 would not include the VM's IP address (192.168.40.2), preventing access. Assigning an external IP to the VM and using it with masterAuthorizedNetworksConfig is unnecessary and bypasses the private access method, which is preferred for security and latency. The question implies a desire for internal access.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed