Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to deploy a container image to Cloud Run.
GCP
gcloud run deploy my-service --image [1] --region us-central1 Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using just the image name without registry and project
Trying to run docker commands instead of specifying image
Using incorrect flags for deployment
✗ Incorrect
The correct image reference for Cloud Run deployment is a full container image path like 'gcr.io/my-project/my-image:latest'.
2fill in blank
mediumComplete the command to create a Kubernetes deployment with 3 replicas.
GCP
kubectl create deployment my-app --image=my-app-image --replicas=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replicas to 0 which means no pods run
Using default 1 when multiple pods are needed
✗ Incorrect
Setting replicas to 3 creates three instances of the application pods.
3fill in blank
hardFix the error in the YAML snippet to expose a Kubernetes deployment as a LoadBalancer service.
GCP
apiVersion: v1 kind: Service metadata: name: my-service spec: type: [1] selector: app: my-app ports: - protocol: TCP port: 80 targetPort: 8080
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ClusterIP which is internal only
Using NodePort which exposes on node ports but not a cloud load balancer
✗ Incorrect
To expose the service externally with a cloud provider load balancer, the type must be 'LoadBalancer'.
4fill in blank
hardFill both blanks to define a Cloud Build trigger that runs on pushes to the main branch.
GCP
trigger:
name: my-trigger
github:
owner: my-org
name: my-repo
triggerTemplate:
branchName: [1]
projectId: [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong branch name like 'develop'
Using an incorrect or placeholder project ID
✗ Incorrect
The trigger should watch the 'main' branch and use the correct GCP project ID.
5fill in blank
hardFill all three blanks to create a Terraform resource for a Google Compute Engine VM instance.
GCP
resource "google_compute_instance" "vm_instance" { name = [1] machine_type = [2] zone = [3] boot_disk { initialize_params { image = "debian-cloud/debian-11" } } network_interface { network = "default" access_config {} } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around strings
Using invalid machine types or zones
✗ Incorrect
The VM name must be a string, machine type a valid type like 'e2-medium', and zone a valid zone string.