A microservices developer needs to deploy a containerized application stored in Artifact Registry (`europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1`) to Google Cloud Run. The deployment must fulfill the following operational criteria:
- Deploy the service under the name `payment-gateway` in the `europe-west1` region.
- Run the container using the custom service account `[email protected]`.
- Allow public HTTP requests without authentication for incoming webhooks.
Which `gcloud` command should the developer execute to meet these requirements?
- gcloud run deploy payment-gateway --image=europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1 --region=europe-west1 --service-account=payment-sa@company-prod.iam.gserviceaccount.com --allow-unauthenticatedAnswer
- Bgcloud functions deploy payment-gateway --image=europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1 --region=europe-west1 --service-account=payment-sa@company-prod.iam.gserviceaccount.com --allow-unauthenticated
- Cgcloud run deploy payment-gateway --image=europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1 --region=europe-west1 --service-account=payment-sa@company-prod.iam.gserviceaccount.com --allow-unauthenticated --port=80
- Dgcloud run deploy payment-gateway --image=europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1 --region=europe-west1 --role=roles/owner --allow-unauthenticated
Answer
The command starting with `gcloud run deploy payment-gateway` with `--image`, `--region=europe-west1`, `--service-account`, and `--allow-unauthenticated` flags correctly deploys the Cloud Run service.
The correct command uses `gcloud run deploy payment-gateway` combined with `--image` pointing to Artifact Registry, specifies `--region=europe-west1` for target location, configures `--service-account` for identity, and includes `--allow-unauthenticated` to permit unauthenticated external webhook invocations.
Step-by-Step Solution
Key Concept
Deploying serverless container workloads to Cloud Run using gcloud CLI flags
Estimated Time:1m 30s