A developer has packaged a microservice into a container image named `gcr.io/my-project/order-service:v1` and needs to deploy it as a fully managed serverless application on Google Cloud. The application must be deployed to the `us-central1` region and allow public unauthenticated HTTP requests. Which `gcloud` command should be used to accomplish this deployment?
- gcloud run deploy order-service --image gcr.io/my-project/order-service:v1 --region us-central1 --allow-unauthenticatedCevap
- Bgcloud functions deploy order-service --image gcr.io/my-project/order-service:v1 --region us-central1 --allow-unauthenticated
- Cgcloud run deploy order-service --image gcr.io/my-project/order-service:v1 --region us-central1 --port 80
- Dgcloud run deploy order-service --image gcr.io/my-project/order-service:v1 --region us-central1 --role roles/owner
Cevap
The command `gcloud run deploy order-service --image gcr.io/my-project/order-service:v1 --region us-central1 --allow-unauthenticated` correctly deploys the container image to Cloud Run with public unauthenticated HTTP access.
To deploy a container image to Cloud Run, the `gcloud run deploy` command is used specifying the service name, the `--image` location, the `--region`, and the `--allow-unauthenticated` flag to allow public HTTP requests.
Adım Adım Çözüm
Anahtar Kavram
Deploying containerized applications to Cloud Run via gcloud CLI
Tahmini Süre:45s