Soru

Zorluk: ZorDeploying and Managing Google Kubernetes Engine (GKE) Clusters and Workloads

A cloud engineer needs to establish a new Google Kubernetes Engine (GKE) environment and deploy a containerized microservice application from scratch using the Google Cloud CLI and `kubectl`. Arrange the following operational steps in the correct chronological sequence required to provision the infrastructure, configure local authentication context, deploy the workload, and verify successful deployment.

  1. 1Provision the GKE cluster using `gcloud container clusters create` with the target region, VPC subnetwork, and node pool flags.
  2. 2Authenticate the local environment and generate cluster endpoint configuration using `gcloud container clusters get-credentials`.
  3. 3Verify API server connectivity and worker node availability by executing `kubectl get nodes`.
  4. 4Deploy the application workload manifest to the cluster using `kubectl apply -f deployment.yaml`.
  5. 5Confirm workload health and successful replica rollout status using `kubectl rollout status deployment/web-app`.

Cevap

The correct operational sequence begins with provisioning the GKE cluster using `gcloud container clusters create`, followed by fetching credentials into `kubeconfig` via `gcloud container clusters get-credentials`, verifying cluster control plane access using `kubectl get nodes`, applying the application manifest with `kubectl apply -f deployment.yaml`, and finally confirming workload health using `kubectl rollout status deployment/web-app`.
Deploying workloads to Google Kubernetes Engine follows a logical multi-step workflow. First, cluster infrastructure must be provisioned (`gcloud container clusters create`). Second, administrative authentication credentials must be written to the local workstation context (`gcloud container clusters get-credentials`). Third, connectivity to the Kubernetes API server must be validated (`kubectl get nodes`). Fourth, the application workload definition must be submitted (`kubectl apply -f`). Finally, workload availability must be confirmed by checking rollout progress (`kubectl rollout status`).

Adım Adım Çözüm

1
Execute `gcloud container clusters create` with appropriate networking and node pool specifications.
GKE control plane and worker node pools are created in Google Cloud.
Infrastructure creation is the mandatory prerequisite before cluster operations can occur.
2
Run `gcloud container clusters get-credentials [CLUSTER_NAME] --zone [ZONE]`.
Local `~/.kube/config` file is populated with cluster API endpoints and authentication tokens.
`kubectl` relies on `kubeconfig` entries to direct commands to the correct Kubernetes control plane.
3
Execute `kubectl get nodes` to test cluster access.
A list of healthy GKE worker nodes and their statuses is returned in stdout.
Verifying connectivity prevents silent deployment failures caused by invalid authentication context.
4
Run `kubectl apply -f deployment.yaml` targeting the application manifest.
Kubernetes API server processes the specification and creates the Deployment resource.
Submitting the manifest initiates Pod scheduling and container creation across available cluster nodes.
5
Execute `kubectl rollout status deployment/web-app` to monitor deployment progress.
Command completes successfully when all replicas are running and ready.
Validating rollout completion confirms that image retrieval, volume mounts, and readiness probes succeeded.

Anahtar Kavram

GKE Workload Lifecycle and Command Sequence
Bu soruyu puanla