An infrastructure team is deploying two serverless microservices to Google Cloud using the gcloud CLI:
1. A containerized backend service deployed to Cloud Run that listens internally on custom TCP port 9090.
2. A lightweight HTTP-triggered webhook processing service deployed as a Cloud Functions (2nd gen) service.
Which TWO configuration choices or gcloud command options must be specified to successfully deploy these serverless applications? (Select TWO.)
- Pass the `--port=9090` flag during `gcloud run deploy` so Cloud Run routes incoming HTTP requests to the container's custom listening port.Answer
- BHardcode the environment variable `PORT=8080` inside the container Dockerfile and rely on Cloud Run to automatically translate incoming traffic from port 9090.
- Execute `gcloud functions deploy` specifying `--gen2` and `--trigger-http` to deploy the webhook processor as a 2nd gen function.Answer
- DExecute `gcloud functions deploy` with the `--image` flag pointing to an Artifact Registry container image to deploy multi-container serverless applications.
Answer
The correct configurations are specifying `--port=9090` in `gcloud run deploy` to instruct Cloud Run to forward ingress traffic to custom port 9090, and executing `gcloud functions deploy` with `--gen2` and `--trigger-http` for the 2nd gen HTTP Cloud Function.
Specifying `--port=9090` during Cloud Run deployment explicitly configures the platform to route incoming HTTP requests to port 9090 inside the container. Additionally, deploying an HTTP-triggered 2nd gen Cloud Function requires `gcloud functions deploy` with the `--gen2` and `--trigger-http` flags.
Step-by-Step Solution
Key Concept
Deploying serverless applications using Cloud Run custom port configurations and Cloud Functions (2nd gen) CLI deployment flags
Estimated Time:2m 0s