A DevOps engineer is deploying a newly containerized Flask web application named `inventory-api` to Google Cloud Run using the `gcloud run deploy` command. The application is configured to listen internally on TCP port 5000 rather than the standard default port. The application needs to be accessible directly from the public internet without requiring IAM authentication header tokens. Which two configuration actions or `gcloud` command flags must be used to successfully deploy this service? (Select TWO.)
- Include the `--port=5000` flag during deployment to direct Cloud Run routing to the application's listening port.Answer
- Include the `--allow-unauthenticated` flag during deployment to enable public HTTP access.Answer
- CHardcode `ENV PORT=8080` in the Dockerfile while leaving the Flask application bound to port 5000.
- DGrant the primitive `roles/owner` role to the default Cloud Run service account to permit unauthenticated inbound HTTP requests.
Answer
To successfully deploy the containerized web application to Cloud Run with public access and custom port routing, you must use the `--port=5000` flag to inform Cloud Run which port the container receives requests on, and use the `--allow-unauthenticated` flag to allow public ingress without authentication.
Deploying containerized applications to Cloud Run requires configuring container ingress port contract and access control. Specifying the flag `--port=5000` ensures Cloud Run routes incoming container requests to port 5000 where Flask is listening. Specifying `--allow-unauthenticated` allows public HTTP clients to invoke the Cloud Run URL without providing GCP authentication credentials.
Step-by-Step Solution
Key Concept
Cloud Run Container Port Binding and Ingress Access Control
Estimated Time:1m 30s