
Explanation:
The correct sequence involves creating a GKE cluster with gcloud container clusters create, fetching its credentials with gcloud container clusters get-credentials, and then applying the Kubernetes resource configurations using kubectl apply -f. The other options either use incorrect commands (kubectl create or gcloud gke apply) or attempt to create a cluster with kubectl, which is not supported. References:
Ultimate access to all questions.
No comments yet.
You need to provision a GKE cluster in your development project and deploy Kubernetes resources defined in two YAML files: deployments.yaml for creating a deployment and service.yaml for setting up a LoadBalancer service. Which command sequence should you use in Cloud Shell to achieve this?
A
gcloud container clusters create cluster-1 --zone=us-central1-a gcloud container clusters get-credentials cluster-1 --zone=us-central1-a kubectl create -f deployment.yaml kubectl create -f service.yaml
B
gcloud container clusters create cluster-1 --zone=us-central1-a gcloud container clusters get-credentials cluster-1 --zone=us-central1-a kubectl apply -f deployment.yaml kubectl apply -f service.yaml
C
gcloud container clusters create cluster-1 --zone=us-central1-a gcloud container clusters get-credentials cluster-1 --zone=us-central1-a gcloud gke apply -f deployment.yaml gcloud gke apply -f service.yaml
D
kubectl container clusters create cluster-1 --zone=us-central1-a kubectl container clusters get-credentials cluster-1 --zone=us-central1-a kubectl apply -f deployment.yaml kubectl apply -f service.yaml