Tüm alıştırma soruları

1591 soru

Soru 1101Soru

A developer needs to execute local gcloud commands to manage Cloud Storage objects on behalf of a target service account, [email protected]. Following Google Cloud security best practices, the developer must temporarily impersonate this service account without downloading static key files. Which IAM configuration correctly enables this service account impersonation?

Cevabı ve açıklamayı göster

Cevap: Grant the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to the developer's user identity on the target service account.

Cevap

Grant the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to the developer's user identity on the target service account.
To impersonate a Google Cloud service account, a principal must be granted the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) on that service account. This allows the principal to create short-lived credentials and act on behalf of the service account without creating or downloading long-lived JSON service account keys.

Adım Adım Çözüm

1
Analyze requirement and security constraints
The requirement is keyless identity delegation (impersonation) for local CLI administration.
GCP security guidelines advise against generating long-lived service account key files.
2
Identify the required IAM permission for identity assumption
The Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) provides permissions to produce short-lived OAuth 2.0 access tokens for impersonation.
Impersonating a service account relies on token minting capabilities.
3
Determine proper IAM binding scope
Bind the Service Account Token Creator role to the user principal directly on the target service account resource.
Applying the role on the specific service account resource enforces the principle of least privilege.

Anahtar Kavram

Configuring Service Account Impersonation
Soru 1102Soru

What is the correct sequence of steps to configure a Kubernetes Service Account (KSA) to impersonate a Google Cloud Service Account (GSA) using GKE Workload Identity?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct operational sequence begins with creating the Google Cloud Service Account with required permissions, followed by creating the Kubernetes Service Account in GKE, binding the Workload Identity User IAM role on the GSA to the KSA, and finally annotating the KSA with the GSA email address.
Configuring Workload Identity follows a logical top-down sequence: first provision the GCP-side Service Account with appropriate permissions, next create the GKE Kubernetes Service Account, then grant the roles/iam.workloadIdentityUser IAM role on the GSA to the KSA, and lastly annotate the KSA with the GSA email address so the GKE metadata server can exchange Kubernetes tokens for Google Cloud credentials.

Adım Adım Çözüm

1
Provision the target Google Cloud Service Account (GSA)
GSA is created with the required GCP IAM permissions for backend resource access.
Before identity delegation can occur, the cloud-level service account with target permissions must exist.
2
Provision the Kubernetes Service Account (KSA)
KSA is available inside the GKE namespace.
Workloads in GKE execute under a Kubernetes identity, which requires a KSA manifest.
3
Configure the IAM Workload Identity binding
The GSA trusts the KSA principal under roles/iam.workloadIdentityUser.
This establishes the GCP security boundary permission allowing the GKE pod identity to act as the cloud service account.
4
Annotate the KSA manifest
The KSA metadata includes key iam.gke.io/gcp-service-account set to the GSA email.
The GKE metadata server reads this annotation to issue short-lived GCP tokens to pods running under this KSA.

Anahtar Kavram

GKE Workload Identity Configuration Sequence
Soru 1103Soru

An enterprise operations team is configuring Google Cloud storage and database resources for a web application. The application requires a database engine capable of handling complex relational schemas with ACID transactions and multi-table SQL joins. Additionally, product assets stored in Google Cloud Storage must have access permissions managed strictly at the bucket level via IAM policies, disabling individual object ACLs. Which TWO operational choices align with these technical requirements?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Provision Cloud SQL as the database solution to support relational schemas, ACID compliance, and SQL join capabilities.; Enable Uniform Bucket-Level Access on the Cloud Storage bucket and grant permissions exclusively using IAM roles.

Cevap

The correct operational choices are provisioning Cloud SQL to handle relational transactions and SQL joins, and enabling Uniform Bucket-Level Access on Cloud Storage to manage permissions via IAM policies.
Provisioning Cloud SQL correctly satisfies the requirement for a relational engine capable of complex SQL joins and ACID compliance. Enabling Uniform Bucket-Level Access on the Cloud Storage bucket ensures permissions are managed uniformly through IAM policies while turning off legacy object-level ACLs.

Adım Adım Çözüm

1
Analyze the database requirements for relational schemas, SQL joins, and ACID compliance.
Identify Cloud SQL (or Cloud Spanner) as the appropriate managed relational database service rather than NoSQL stores like Bigtable.
Cloud Bigtable is optimized for heavy NoSQL key-value throughput and does not support multi-table SQL joins.
2
Evaluate the storage permission requirement for bucket-level IAM control.
Select Uniform Bucket-Level Access on Cloud Storage.
Enforcing Uniform Bucket-Level Access disables fine-grained object ACLs and centralizes access management via Google Cloud IAM.

Anahtar Kavram

Selecting appropriate GCP storage and database engines based on query pattern and access control requirements.
Soru 1104Soru

An organization is configuring access for an automated data pipeline in a Google Cloud project named `analytics-prod`. A dedicated service account used by a Cloud Run service requires read access to objects stored in a specific Cloud Storage bucket named `raw-data-vault`. Simultaneously, a data analyst requires access to create query jobs and view table data within BigQuery in the `analytics-prod` project. Security policies mandate strict adherence to the principle of least privilege while preventing unnecessary permission inheritance across the resource hierarchy. Which TWO IAM role assignments should the cloud engineer configure?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Grant the service account the Storage Object Viewer role (`roles/storage.objectViewer`) bound directly on the `raw-data-vault` bucket.; Grant the data analyst the BigQuery Data Viewer (`roles/bigquery.dataViewer`) and BigQuery Job User (`roles/bigquery.jobUser`) roles on the `analytics-prod` project.

Cevap

Grant the service account the Storage Object Viewer role (`roles/storage.objectViewer`) bound directly on the `raw-data-vault` bucket, and grant the data analyst the BigQuery Data Viewer (`roles/bigquery.dataViewer`) and BigQuery Job User (`roles/bigquery.jobUser`) roles on the `analytics-prod` project.
To comply with the principle of least privilege, permissions should be granted at the narrowest relevant resource scope using predefined roles tailored to specific tasks. Binding the Storage Object Viewer role directly to the specific bucket limits the service account's read access strictly to objects in that bucket. Combining BigQuery Data Viewer and BigQuery Job User at the project level provides the analyst with exact rights to run queries and view data without broader project modification capabilities.

Adım Adım Çözüm

1
Evaluate the access requirement for the Cloud Run service account.
The service account needs read-only access to objects inside a single bucket (`raw-data-vault`).
Applying `roles/storage.objectViewer` at the resource level (bucket) restricts access to only that specific bucket rather than all buckets in the project or organization.
2
Evaluate the access requirement for the data analyst.
The analyst needs to execute BigQuery queries and inspect dataset tables within `analytics-prod`.
Predefined roles `roles/bigquery.dataViewer` (for table data read) and `roles/bigquery.jobUser` (for running query jobs) satisfy these needs without over-granting project-wide administrative rights.
3
Filter out over-scoped roles and improper hierarchy bindings.
Reject assigning roles at the Organization level and reject broad primitive roles like Editor.
Hierarchy inheritance propagates higher-level bindings downwards, and primitive roles grant excessively wide permissions.

Anahtar Kavram

Applying Least Privilege IAM Role Scope and Predefined Roles
Soru 1105Soru

A software engineering team built a Node.js microservice packaged as a custom container image stored in Artifact Registry. The internal web server application inside the container is explicitly configured to listen on port 5000. The team must deploy this service to Cloud Run in region us-central1 using a custom identity service account named [email protected] and ensure that unauthenticated requests are blocked. Which gcloud command should be executed to accomplish this deployment?

Cevabı ve açıklamayı göster

Cevap: gcloud run deploy node-api --image=us-central1-docker.pkg.dev/company-project/apps/node-api:v1 --port=5000 --service-account=api-runner@company-project.iam.gserviceaccount.com --no-allow-unauthenticated --region=us-central1

Cevap

The command 'gcloud run deploy node-api --image=us-central1-docker.pkg.dev/company-project/apps/node-api:v1 --port=5000 --service-account=api-runner@company-project.iam.gserviceaccount.com --no-allow-unauthenticated --region=us-central1' correctly configures the non-default port 5000, attaches the designated service account, and enforces authentication requirements.
The correct command explicitly sets the container port to 5000 via '--port=5000', matching the internal port of the web server. It also correctly attaches the designated custom service account and includes '--no-allow-unauthenticated' to enforce authentication controls.

Adım Adım Çözüm

1
Identify the target deployment platform and container runtime port requirements.
The application is a custom web server container listening on port 5000 targeted for Cloud Run.
Cloud Run forwards ingress traffic to port 8080 by default; custom ports must be explicitly defined using the --port flag.
2
Determine the necessary security and identity flags for gcloud run deploy.
Set --service-account=api-runner@company-project.iam.gserviceaccount.com and append --no-allow-unauthenticated.
Ensures principle of least privilege for execution identity while preventing anonymous public invocation.
3
Assemble and verify the complete deployment command.
Combine image location, port override, service account assignment, region, and security flags into a single gcloud execution statement.
Guarantees that the revision starts up properly and adheres to security constraints.

Anahtar Kavram

Configuring custom container port bindings and execution identities when deploying Cloud Run services via gcloud CLI.
Soru 1106Soru

A cloud engineer is deploying a Cloud SQL for PostgreSQL instance named 'orders-db' in a custom VPC network named 'production-vpc'. To meet security and operational compliance, the database instance must accept traffic exclusively via Private IP, enforce SSL/TLS encryption for all incoming client connections, and automatically increase storage capacity when available disk space is low. Which gcloud command correctly provisions this managed database instance?

Cevabı ve açıklamayı göster

Cevap: gcloud sql instances create orders-db --database-version=POSTGRES_15 --network=production-vpc --no-assign-ip --ssl-mode=ENCRYPTED_ONLY --enable-auto-increase

Cevap

The command 'gcloud sql instances create orders-db --database-version=POSTGRES_15 --network=production-vpc --no-assign-ip --ssl-mode=ENCRYPTED_ONLY --enable-auto-increase' correctly satisfies all requirements.
The correct choice utilizes valid gcloud CLI flags for Cloud SQL deployment: '--no-assign-ip' removes public IP exposure, '--network=production-vpc' attaches the instance to Private Service Access, '--ssl-mode=ENCRYPTED_ONLY' requires SSL/TLS client connections, and '--enable-auto-increase' turns on automatic disk size expansion.

Adım Adım Çözüm

1
Identify Private IP provisioning requirements for Cloud SQL
Using '--no-assign-ip' disables public IP allocation, while '--network=production-vpc' binds the instance to Private Service Access inside the custom VPC.
Ensures network connectivity remains internal and secure within Google Cloud.
2
Identify SSL/TLS enforcement and auto-scaling flags
'--ssl-mode=ENCRYPTED_ONLY' enforces encrypted connections, and '--enable-auto-increase' enables automatic storage expansion.
Fulfills compliance requirements for encrypted data transit and operational reliability.

Anahtar Kavram

Deploying Cloud SQL instances with Private IP, SSL enforcement, and storage auto-increase via gcloud CLI
Soru 1107Soru

A company is deploying a self-managed relational database on a Compute Engine virtual machine to handle internal order processing. The database requires persistent block storage that retains data across instance restarts and supports point-in-time snapshots for disaster recovery. The workload requires baseline SSD performance for daily operations but does not need peak performance or extreme IOPS scaling. The engineering team wants to minimize storage costs while satisfying these operational requirements. Which storage configuration should you select?

Cevabı ve açıklamayı göster

Cevap: Balanced Persistent Disk (pd-balanced)

Cevap

Balanced Persistent Disk (pd-balanced)
Balanced Persistent Disk (pd-balanced) is a cost-effective SSD-backed block storage option in Google Cloud. It provides reliable SSD performance suitable for mainstream relational database workloads while maintaining full support for data persistence across instance restarts and scheduled snapshots.

Adım Adım Çözüm

1
Analyze persistence and backup requirements
The storage must persist across VM restarts and support point-in-time snapshots.
Local SSDs are ephemeral block devices that reset data on instance stop/terminate and do not support GCP native snapshots.
2
Determine appropriate architecture type
A block storage disk volume is required for mounting on a Compute Engine virtual machine.
Cloud Bigtable is an independent managed NoSQL service and cannot act as a block storage volume for self-managed software on Compute Engine.
3
Select the optimal disk type for performance and cost
Balanced Persistent Disk (pd-balanced) delivers baseline SSD performance at a lower price point than SSD Persistent Disk (pd-ssd).
pd-balanced is Google Cloud's recommended choice for general-purpose workloads and databases that require SSD latency without paying for peak IOPS.

Anahtar Kavram

Selecting Compute Engine Persistent Disk types based on performance, persistence, snapshot support, and cost optimization
Soru 1108Soru

An infrastructure team is preparing to deploy a set of virtual machine instances into a target Google Cloud project named `infra-prod-882` using Google Cloud Deployment Manager. When executing the `gcloud deployment-manager deployments create` command, the deployment fails with an error stating that `compute.googleapis.com` is disabled. Which action must be taken to successfully execute the deployment?

Cevabı ve açıklamayı göster

Cevap: Enable the Compute Engine API directly within the target project `infra-prod-882` before launching the deployment.

Cevap

Enable the Compute Engine API directly within the target project `infra-prod-882` before launching the deployment.
In Google Cloud, infrastructure management tools such as Deployment Manager and Terraform interact with Google Cloud APIs on behalf of the project. Every GCP project must have the relevant service APIs (such as `compute.googleapis.com` for VMs and networks) explicitly enabled within that specific project before resources can be created.

Adım Adım Çözüm

1
Analyze the error message from Deployment Manager
The error indicates `compute.googleapis.com` is disabled in project `infra-prod-882`.
Deployment Manager acts as an orchestrator that calls underlying GCP service APIs; if the API is disabled in the target project, resource creation fails.
2
Determine the scope of API enablement in Google Cloud
Recognize that service API enablement is project-specific.
APIs must be explicitly enabled in the project where the resources will be instantiated.
3
Enable the required API and retry deployment
Execute `gcloud services enable compute.googleapis.com --project=infra-prod-882` and then re-run the deployment.
Enabling the API in `infra-prod-882` grants Deployment Manager permission to provision Compute Engine resources in that project.

Anahtar Kavram

Project-scoped API enablement for Infrastructure as Code deployments
Tahmini Süre:1m 30s
Soru 1109Soru

A platform engineer is configuring autoscaling for a state-agnostic API service running on a Google Kubernetes Engine (GKE) Standard cluster. During peak traffic hours, existing pods experience high CPU utilization, and incoming pods remain in a Pending state because the current worker nodes lack remaining CPU capacity to schedule them. Which TWO scaling mechanisms must be configured together to automatically handle both pod load and node capacity constraints? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Configure a Horizontal Pod Autoscaler (HPA) targeting the deployment to increase the number of pod replicas as CPU utilization rises.; Enable Cluster Autoscaler on the GKE node pool to automatically add worker nodes when pods cannot be scheduled due to insufficient resources.

Cevap

To address both pod-level CPU load spikes and node-level capacity shortages, you must combine Horizontal Pod Autoscaler (HPA) to scale pod replica counts with Cluster Autoscaler to scale node pool capacity.
Scaling a GKE workload under heavy load requires a two-tiered scaling approach: the Horizontal Pod Autoscaler (HPA) scales out the number of running pod replicas when CPU usage exceeds target thresholds, while Cluster Autoscaler detects when newly created pods cannot fit onto existing nodes (Pending status) and dynamically adds worker nodes to the GKE node pool.

Adım Adım Çözüm

1
Identify the mechanism for scaling pod replicas based on workload metrics.
Horizontal Pod Autoscaler (HPA) automatically scales the number of pods in a deployment based on observed metrics like CPU or memory utilization.
HPA ensures that individual pod instances are added when application traffic causes CPU utilization to spike.
2
Identify the mechanism for expanding node capacity when pods cannot be scheduled.
Cluster Autoscaler detects pods stuck in a Pending state due to insufficient cluster resources and adds Compute Engine VMs to the node pool.
Adding pod replicas via HPA will fail to run if the nodes are out of allocatable CPU; Cluster Autoscaler resolves this node capacity bottleneck.

Anahtar Kavram

GKE Horizontal Pod Autoscaler vs. Cluster Autoscaler operational boundaries
Tahmini Süre:1m 30s
Soru 1110Soru

A DevOps engineer manages a production Cloud Run service named `billing-service` deployed in the `us-central1` region. To test a performance optimization patch in production with minimal risk, the engineer deployed a new revision named `billing-service-00002-patch` using the `--no-traffic` flag. Currently, 100%100\% of production traffic continues to be routed to the baseline revision `billing-service-00001-base`. The engineer must now configure the service to route 15%15\% of incoming traffic to `billing-service-00002-patch` while leaving the remaining 85%85\% on `billing-service-00001-base`.

Which `gcloud` command should the engineer execute to implement this precise traffic split?

Cevabı ve açıklamayı göster

Cevap: gcloud run services update-traffic billing-service --region us-central1 --to-revisions billing-service-00002-patch=15,billing-service-00001-base=85

Cevap

The command `gcloud run services update-traffic billing-service --region us-central1 --to-revisions billing-service-00002-patch=15,billing-service-00001-base=85` correctly adjusts the traffic allocation between existing Cloud Run revisions.
The correct command utilizes `gcloud run services update-traffic` with the `--to-revisions` flag to explicitly allocate 15%15\% of traffic to `billing-service-00002-patch` and 85%85\% to `billing-service-00001-base`. This adheres directly to GCP Cloud Run traffic management specifications.

Adım Adım Çözüm

1
Identify the target Cloud Run service and region
Service name is `billing-service` and region is `us-central1`.
Cloud Run service management requires specifying the service identifier and regional scope.
2
Determine the CLI command sub-group for traffic routing
Use `gcloud run services update-traffic`.
Traffic allocations across revisions are managed via the `update-traffic` command sub-group rather than standard image deployments or environment variable updates.
3
Specify explicit revision traffic percentages
Pass `--to-revisions billing-service-00002-patch=15,billing-service-00001-base=85`.
The `--to-revisions` flag takes a comma-separated key-value list mapping revision names to integer percentages summing to 100%100\%.

Anahtar Kavram

Cloud Run Revision Traffic Splitting
Tahmini Süre:2m 0s
Soru 1111Soru

A DevOps team needs to route application logs generated by workloads running in Google Cloud Project-A to a central BigQuery dataset hosted in Project-B for long-term security compliance and querying. Which TWO actions must be configured to successfully set up this log export?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Log Router sink in Project-A with a inclusion filter for application logs, specifying the BigQuery dataset in Project-B as the destination.; Grant the Log Router sink's writer service account the BigQuery Data Editor role on the destination dataset in Project-B.

Cevap

To export logs across projects to BigQuery, you must create a Log Router sink in the source project specifying the destination dataset path, and grant the generated sink writer service account appropriate access (such as BigQuery Data Editor) on the destination dataset.
Exporting logs to a BigQuery dataset in another project requires two main elements: defining the sink with an inclusion filter in the source project pointing to the target BigQuery destination, and assigning appropriate IAM permissions (such as BigQuery Data Editor) to the sink's uniquely generated writer service account in the target project dataset.

Adım Adım Çözüm

1
Configure the Log Router sink in the source project.
A sink filter identifies matching logs in Project-A and targets the dataset in Project-B (`bigquery.googleapis.com/projects/Project-B/datasets/dataset_name`).
Log export rules are defined at the source project level where log entries are emitted.
2
Identify the writer service account created by Cloud Logging for the sink.
A unique service account identity (formatted like `[email protected]`) is generated.
Cloud Logging uses service accounts to authenticate log delivery across project boundaries.
3
Grant dataset-level IAM permissions in the destination project.
The sink writer service account receives the BigQuery Data Editor role on the target dataset in Project-B.
Without explicit IAM write access on the destination dataset, log export will fail due to permission denied errors.

Anahtar Kavram

Log Router Sink Cross-Project Configuration and IAM Service Account Authorization
Soru 1112Soru

A platform engineering team is setting up Terraform to manage Google Cloud networking infrastructure across multiple developer environments. To adhere to security best practices, the team wants to centrally store state files with automatic state locking while eliminating the risk of exposed long-lived service account credentials on local engineer workstations. Which TWO configuration steps should the team perform to fulfill these requirements? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Define a `backend "gcs"` block inside the Terraform configuration referencing a central Cloud Storage bucket, and run `terraform init`.; Configure `impersonate_service_account` in the Terraform Google provider block to allow engineers to authenticate using their individual Google user credentials.

Cevap

The team should configure a `backend "gcs"` block in the Terraform configuration followed by executing `terraform init`, and configure service account impersonation using `impersonate_service_account` in the Google provider configuration.
Configuring the `backend "gcs"` block with `terraform init` provisions centralized, state-locked storage in Google Cloud Storage. Utilizing `impersonate_service_account` within the Google provider ensures engineers authenticate via short-lived tokens without storing sensitive JSON private key files locally.

Adım Adım Çözüm

1
Configure remote state storage using Google Cloud Storage.
Specifying `backend "gcs"` and executing `terraform init` migrates the local state file to Cloud Storage and enables state locking.
Centralizing state storage prevents state file conflicts across team members and ensures consistent infrastructure state tracking.
2
Configure short-lived credential access using IAM impersonation.
Adding `impersonate_service_account` to the Google provider configuration allows users to assume service account permissions dynamically.
Impersonation eliminates the requirement to generate and store static service account JSON keys on local disk.

Anahtar Kavram

Terraform Remote Backend and Service Account Impersonation in Google Cloud
Soru 1113Soru

An organization is configuring security policies for container image management within a Google Cloud project named `prod-app-repo`. An application deployment team requires access to push and pull container images in Artifact Registry repositories in this project. Simultaneously, a compliance auditor needs read-only access to view repository metadata without the ability to modify or delete artifacts. Adhering strictly to the principle of least privilege, which two IAM configuration actions should you perform? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Grant `roles/artifactregistry.writer` to the application deployment team on project `prod-app-repo`.; Grant `roles/artifactregistry.reader` to the compliance auditor on project `prod-app-repo`.

Cevap

Grant the Artifact Registry Writer role (`roles/artifactregistry.writer`) to the deployment team at the project level, and grant the Artifact Registry Reader role (`roles/artifactregistry.reader`) to the compliance auditor at the project level.
To satisfy least privilege for container management, the application deployment team should be assigned the predefined Artifact Registry Writer role (`roles/artifactregistry.writer`) at the project level, granting necessary push and pull permissions without excess access. The auditor should be assigned the Artifact Registry Reader role (`roles/artifactregistry.reader`) at the project level, which limits access to viewing repository items and metadata.

Adım Adım Çözüm

1
Analyze required permissions for the application deployment team.
The team needs permissions to push and pull artifacts in Artifact Registry repositories within `prod-app-repo`.
Applying the predefined role `roles/artifactregistry.writer` at the project level fulfills the required read/write capabilities without granting excess permissions.
2
Analyze required permissions for the compliance auditor.
The auditor requires read-only metadata viewing access within `prod-app-repo`.
Applying the predefined role `roles/artifactregistry.reader` at the project level grants read access to artifacts and metadata while preventing modifications.
3
Validate scope and least privilege alignment.
Project-level predefined role bindings isolate permissions to the targeted project and prevent unnecessary privileges across other folder or primitive resources.
Avoid primitive roles (`roles/editor`) and broad hierarchy scopes (folder/organization level) when specific project-level predefined roles are available.

Anahtar Kavram

Selecting specific predefined IAM roles at the appropriate resource hierarchy scope in accordance with the Principle of Least Privilege.
Soru 1114Soru

You need to create a new service account named "app-scanner" in your Google Cloud project using the command-line interface. Which gcloud command should you run to accomplish this?

Cevabı ve açıklamayı göster

Cevap: gcloud iam service-accounts create app-scanner --display-name="App Scanner"

Cevap

Execute the command 'gcloud iam service-accounts create app-scanner --display-name="App Scanner"' to create the service account.
To create a new service account in GCP using the gcloud CLI, the correct command syntax is 'gcloud iam service-accounts create [SA_NAME]'. Additional options such as '--display-name' can be specified to provide a descriptive label.

Adım Adım Çözüm

1
Identify the gcloud command group responsible for service account management
The command group is 'gcloud iam service-accounts'.
Service account entities are managed under the IAM service accounts subgroup within the gcloud CLI.
2
Select the sub-command used for creating a new service account identity
The sub-command is 'create'.
The 'create' command provisions a new service account resource with the specified service account ID and optional display name.

Anahtar Kavram

Creating service accounts using gcloud CLI
Soru 1115Soru

A DevOps engineer is deploying a specialized compute workload on Google Cloud attached to GPU hardware accelerators. Compute Engine GPU instances do not support live migration. The application configuration requires that if host maintenance occurs, the instance must terminate instead of migrating, and it should not restart automatically if the host experiences an unexpected outage. Which flags must be passed to the `gcloud compute instances create` command to configure this availability behavior correctly?

Cevabı ve açıklamayı göster

Cevap: --on-host-maintenance=TERMINATE --no-automatic-restart

Cevap

The correct option sets `--on-host-maintenance=TERMINATE` and `--no-automatic-restart`.
Compute Engine instances attached to GPU accelerators cannot undergo live migration. Consequently, their host maintenance policy must be set to `TERMINATE` via `--on-host-maintenance=TERMINATE`. To ensure the VM does not automatically reboot following a host disruption, `--no-automatic-restart` must be specified.

Adım Adım Çözüm

1
Identify host maintenance limitations for GPU instances in Compute Engine
Live migration is not supported for VMs with GPUs; therefore, maintenance behavior must be explicitly configured to terminate the instance.
Compute Engine requires `--on-host-maintenance` to be set to `TERMINATE` whenever GPUs are attached to the VM instance.
2
Determine the parameter flag for disabling automatic restarts upon host failure
Use `--no-automatic-restart` to prevent Google Cloud from restarting the VM automatically after an infrastructure failure.
The default setting is `--automatic-restart`, so explicit inclusion of `--no-automatic-restart` overrides this behavior.
3
Validate the `gcloud` CLI flag names
Combine `--on-host-maintenance=TERMINATE` and `--no-automatic-restart` in the `gcloud compute instances create` command.
This matches official Google Cloud CLI parameter naming conventions.

Anahtar Kavram

Compute Engine Availability Policies and GPU Instance Maintenance Configuration
Soru 1116Soru

An organization runs an enterprise application on Google Kubernetes Engine (GKE) in `project-app-prod`. The application needs to read objects from a Cloud Storage bucket located in a separate project, `project-data-shared`. Security policies strictly mandate adherence to the principle of least privilege and prohibit creating or downloading long-lived service account private keys (`.json` key files). Which of the following configuration steps must you perform to grant the application keyless cross-project access securely? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Grant the predefined Cloud Storage Object Viewer role (`roles/storage.objectViewer`) to the Google Service Account directly on the target Cloud Storage bucket in `project-data-shared`.; Bind the Kubernetes Service Account (KSA) to the Google Service Account (GSA) by granting the `roles/iam.workloadIdentityUser` role on the GSA to the KSA principal member.

Cevap

To securely enable cross-project access without static credentials, you must grant the Google Service Account the predefined Cloud Storage Object Viewer role (`roles/storage.objectViewer`) on the target bucket in `project-data-shared`, and bind the Kubernetes Service Account to the Google Service Account using the `roles/iam.workloadIdentityUser` role.
The combination of granting the `roles/iam.workloadIdentityUser` role on the Google Service Account to the Kubernetes Service Account and assigning `roles/storage.objectViewer` directly on the destination storage bucket establishes a secure, keyless cross-project authentication path adhering strictly to least privilege.

Adım Adım Çözüm

1
Configure Workload Identity mapping between Kubernetes and Google Cloud IAM.
The Kubernetes Service Account (KSA) used by the GKE deployment is granted the `roles/iam.workloadIdentityUser` role on the Google Service Account (GSA).
This allows GKE pods to automatically request short-lived Google OAuth2 tokens without needing downloadable static JSON keys.
2
Assign targeted IAM permissions on the destination Cloud Storage resource.
The GSA is granted `roles/storage.objectViewer` on the specific Cloud Storage bucket inside `project-data-shared`.
Applying predefined roles directly on the target resource enforces least privilege and avoids granting excessive project-wide permissions.

Anahtar Kavram

Cross-Project Service Account Management and Workload Identity
Soru 1117Soru

An operations team manages a Google Cloud Storage bucket used for storing raw media uploads. To adhere to corporate governance and optimize operational costs, the team must ensure that object access is managed exclusively via Google Cloud IAM without per-object Access Control Lists (ACLs). Furthermore, active objects must automatically transition to Coldline Storage after 30 days of inactivity, and noncurrent object versions must be purged after 90 days. Which TWO actions should the cloud engineer take to fulfill these operational requirements?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Enable Uniform Bucket-Level Access on the Cloud Storage bucket.; Configure Object Lifecycle Management rules on the bucket to set the storage class to Coldline for objects older than 30 days and delete noncurrent versions older than 90 days.

Cevap

The cloud engineer should enable Uniform Bucket-Level Access on the Cloud Storage bucket and configure Object Lifecycle Management rules to transition objects to Coldline Storage after 30 days and delete noncurrent versions after 90 days.
Enabling Uniform Bucket-Level Access ensures all permissions are governed strictly through Cloud IAM, disabling individual object ACLs. Defining Object Lifecycle Management rules automatically shifts aging objects to lower-cost Coldline Storage and purges noncurrent versions, meeting both cost and operational compliance requirements.

Adım Adım Çözüm

1
Enforce unified Cloud IAM permissions on the Cloud Storage bucket
Disables per-object ACL evaluation and enforces consistent IAM policy across all objects.
Uniform Bucket-Level Access streamlines security administration and fulfills centralized governance policies.
2
Configure Object Lifecycle Management lifecycle rules for age and versioning conditions
Automates class migration to Coldline Storage at 30 days and permanent deletion of noncurrent versions at 90 days.
Automated lifecycle management reduces storage expenses without requiring manual operational scripts.

Anahtar Kavram

Cloud Storage Object Lifecycle Management and Uniform Bucket-Level Access
Soru 1118Soru

An enterprise financial service runs a critical stateless application deployed inside a regional Managed Instance Group (MIG) in `us-central1`. The team needs to deploy a newly created instance template (`finapp-v2`) to the MIG with zero application downtime. Additionally, operational monitoring alerts reveal that during peak traffic events, the MIG attempts to autoscale beyond its current capacity but fails because the project has reached its regional N2 CPU quota limit. Which TWO actions should you perform to execute the update seamlessly and resolve the operational bottleneck?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Perform a rolling update on the MIG referencing the new instance template while setting the maximum unavailable instances to zero.; Request a quota increase for N2 CPUs in the target region through the Google Cloud Console or gcloud Quotas API.

Cevap

To update the Managed Instance Group without downtime and resolve the autoscaling quota bottleneck, you must perform a rolling update specifying zero maximum unavailable instances and submit a formal request for an N2 CPU quota increase in the target region.
Updating a Managed Instance Group requires creating a new instance template and starting a rolling update configured with zero maximum unavailable instances so that application availability is maintained throughout the rollout. When instance capacity is bounded by project limits, the correct operational procedure is to request a regional quota increase via the GCP Console or Quotas API.

Adım Adım Çözüm

1
Identify the instance template update mechanism
Recognize that instance templates are immutable, requiring a new template and a rolling update policy with `--max-unavailable=0` to guarantee zero downtime.
Setting max unavailable to zero forces the MIG to spin up new instances before taking old instances offline.
2
Identify the quota bottleneck solution
Submit an official quota increase request for N2 CPUs in the `us-central1` region via the Cloud Console IAM & Admin Quotas page or gcloud CLI.
Regional quotas limit resource consumption across all zones in a region regardless of IAM permissions or instance group configurations.

Anahtar Kavram

Compute Engine MIG rolling update strategy and GCP regional quota management workflows.
Soru 1119Soru

An engineering team is deploying an application to Google Kubernetes Engine (GKE) that requires access to a Google Cloud Storage bucket. To adhere to security best practices, the team decides to use Workload Identity instead of exporting static service account keys. What is the correct sequence of steps to configure Workload Identity binding between the Kubernetes Service Account (KSA) and the GCP Service Account (GSA)?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct order to configure Workload Identity is: First, create the GCP Service Account with resource permissions. Second, create the Kubernetes Service Account in the cluster namespace. Third, bind the Workload Identity User role on the GCP Service Account to the Kubernetes Service Account principal. Fourth, annotate the Kubernetes Service Account with the GCP Service Account email. Fifth, configure and deploy the Pod using the annotated Kubernetes Service Account.
The configuration of Workload Identity requires creating the GCP Service Account with access permissions and the Kubernetes Service Account in the cluster, granting the roles/iam.workloadIdentityUser IAM role on the GCP Service Account to the Kubernetes Service Account member URI, annotating the Kubernetes Service Account with the GCP Service Account email, and finally attaching the annotated Kubernetes Service Account to the Pod definition.

Adım Adım Çözüm

1
Provision GCP Service Account
GCP Service Account exists with IAM bucket permissions.
Resource permissions must belong to a Google Cloud identity that will be impersonated.
2
Provision Kubernetes Service Account
KSA created in GKE namespace.
Workload Identity maps a specific Kubernetes Service Account to a GCP Service Account.
3
Allow KSA to impersonate GSA via IAM
roles/iam.workloadIdentityUser assigned to serviceAccount:PROJECT_ID.svc.id.goog[NAMESPACE/KSA_NAME].
Without this IAM role assignment, GCP IAM blocks the Workload Identity impersonation attempt.
4
Annotate KSA with GSA email
KSA includes annotation iam.gke.io/gcp-service-account=GSA_EMAIL.
The annotation tells the GKE Metadata Server which GSA tokens to issue when the workload requests credentials.
5
Deploy Pod with KSA reference
Pod runs using the annotated service account and obtains GCP access transparently.
Setting serviceAccountName in the Pod spec ties the pod execution to the configured Workload Identity mapping.

Anahtar Kavram

Workload Identity allows GKE workloads to impersonate a GCP Service Account by binding the roles/iam.workloadIdentityUser role to the Kubernetes Service Account identity string and annotating the KSA.
Soru 1120Soru

A Cloud Engineer discovers that a daily log export process into a Cloud Storage bucket is incurring high operational costs. Inspection reveals an Object Lifecycle Management rule configured to transition objects to the Coldline storage class zero days after creation. However, an automated analytics pipeline reads these newly created log files multiple times daily during their first two weeks before access drops completely. Which action should the engineer take to resolve the issue and optimize costs?

Cevabı ve açıklamayı göster

Cevap: Modify the lifecycle rule to keep objects in Standard storage for 30 days before transitioning them to Coldline storage.

Cevap

Modify the lifecycle rule to keep objects in Standard storage for 30 days before transitioning them to Coldline storage.
Cloud Storage Standard storage carries no retrieval fee, making it the most economical choice for data accessed repeatedly during the first two weeks. Delaying the transition to Coldline until after 30 days eliminates retrieval fee penalties while ensuring long-term storage savings once queries cease.

Adım Adım Çözüm

1
Analyze access patterns and storage class pricing mechanics.
Identified that logs are read frequently during the first two weeks after creation.
Coldline storage incurs retrieval costs per gigabyte read, making it unsuitable for frequently accessed data.
2
Evaluate Object Lifecycle Management lifecycle transition rules.
Transitioning immediately (day 0) to Coldline incurs heavy retrieval charges every time the analytics pipeline reads the new logs.
Standard storage has no retrieval fee, making it cheaper for short-term active reading.
3
Select the optimal lifecycle rule policy.
Keep objects in Standard storage while actively queried, then transition to Coldline after 30 days when access drops.
This aligns storage class tiering with actual access patterns to minimize total operational costs.

Anahtar Kavram

Cloud Storage Lifecycle Management and Retrieval Cost Optimization
ÖncekiSayfa 56 / 80Sonraki
Tüm alıştırma soruları — Google Cloud Associate Cloud Engineer | Examkin