# Cloud Run service deployment fails with 'Quota exceeded for resource: 'projects/my-project/regions/us-central1/quotas/max-instances'. Limit: 100, Usage: 100'

- **ID:** `policy/cloud-run-max-instances-quota-exceeded`
- **Domain:** policy
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The Cloud Run service's max-instances setting (or the sum of all services' max-instances in the region) exceeds the regional quota for max instances, which is typically 100 by default.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Cloud Run API v1 | active | — | — |
| gcloud CLI 400.0.0+ | active | — | — |
| Google Cloud Console as of 2024 | active | — | — |

## Workarounds

1. **Identify all Cloud Run services in the region using `gcloud run services list --region=us-central1`, sum their max-instances values, and reduce the max-instances on one or more services to bring the total under the quota (e.g., 100). Then redeploy.** (90% success)
   ```
   Identify all Cloud Run services in the region using `gcloud run services list --region=us-central1`, sum their max-instances values, and reduce the max-instances on one or more services to bring the total under the quota (e.g., 100). Then redeploy.
   ```
2. **Request a quota increase via the Google Cloud Console: go to IAM & Admin > Quotas, find 'Max instances per region' for Cloud Run, and request an increase (e.g., to 200). This may take 1-2 business days.** (70% success)
   ```
   Request a quota increase via the Google Cloud Console: go to IAM & Admin > Quotas, find 'Max instances per region' for Cloud Run, and request an increase (e.g., to 200). This may take 1-2 business days.
   ```
3. **Set max-instances to 0 (which means no limit) only if the service is CPU-throttled and can handle cold starts, but note this bypasses the quota check only if the total usage is under the limit. If the total is already at the limit, this will still fail.** (30% success)
   ```
   Set max-instances to 0 (which means no limit) only if the service is CPU-throttled and can handle cold starts, but note this bypasses the quota check only if the total usage is under the limit. If the total is already at the limit, this will still fail.
   ```

## Dead Ends

- **** — The quota error is about the total sum of max-instances across all services in the region, not just one service. Reducing one service may not bring the total under the limit if other services have high values. (60% fail)
- **** — The quota is persistent and region-level. Deleting and recreating does not change the usage count until the service is fully removed, and the new deployment will still fail if the quota is exceeded. (80% fail)
- **** — This will immediately exceed the quota even more, causing the same error. The quota limit is enforced at deployment time. (90% fail)
