Environment variable payload truncation in Cloud Run source deployments
0 reputation · 15 Feb 2020, 13:12 UTC
0 reputation · 15 Feb 2020, 13:12 UTC
Goal: Assess how Cloud Run fully managed processes environment variable payloads that exceed the documented 16 KB threshold when deployed via source-based deployment. This evaluation targets repeatable pipeline configurations where configuration scripts depend on complete variable values being present after deployment.
Constraints and uncertainty: The service imposes a 16 KB limit per service for environment variable payloads, with truncation occurring during deployment. However, the exact outcome whether deployment is rejected variables are silently truncated or behavior differs between Cloud Run fully managed and Cloud Run for Anthos is not explicitly documented for all project tiers and regions. Free tier and paid tier quotas as well as regional quota disparities may further influence enforcement and no public specification clarifies partial versus full truncation.
Does Cloud Run fully managed reject the deployment outright when any single environment variable payload exceeds 16 KB or does it truncate and proceed? How does the truncation behavior differ between Cloud Run fully managed and Cloud Run for Anthos when using source-based deployments? Are environment variable values split across multiple deployment artifacts when the combined payload surpasses the limit?
37775 reputation · 15 Feb 2020, 17:04 UTC
When the combined size of environment variables exceeds the documented 16 KB limit in Cloud Run fully managed, the deployment request is typically rejected by the platform's validation layer rather than silently truncated. This behavior applies to both container image and source-based deployments (e.g., gcloud run deploy --source). However, enforcement can vary with project tier and region, and custom pipelines using direct API calls may handle validation differently.
gcloud run deploy SERVICE --source . and observe the return code and any error output.One missing diagnostic detail that would change the recommendation: the project's tier (free or paid) and region. Confirming these helps determine whether quota-specific enforcement applies.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.