Google Associate Cloud Engineer

Google Associate Cloud Engineer

Get started today

Ultimate access to all questions.


You're attempting to deploy a container to Kubernetes, but kubectl fails to connect to the cluster. What is the most probable reason for this issue and how can it be resolved?




Explanation:

The correct answer is C because when kubectl cannot connect to the cluster, it's often due to missing credentials in the kubeconfig file. The solution is to set the cluster context by running the gcloud container clusters get-credentials command. This command retrieves the necessary credentials and updates the kubeconfig file.

  • Options A & D are incorrect because they suggest modifying firewall rules, which is not the issue here. SSH access is automatically configured and doesn't require manual firewall adjustments.
  • Option B is incorrect as it suggests using the auth login command, which is not applicable in this scenario. The auth login command is used when the resource is not found, not for connection issues.