From 96c9585fb1fd9fc39619d6ad18d6c21043efec57 Mon Sep 17 00:00:00 2001 From: Jonathan Greger <43762185+jmgreger@users.noreply.github.com> Date: Thu, 7 Apr 2022 11:42:51 -0400 Subject: [PATCH 1/8] Set default container limits and concurrency value --- variables.tf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index b05ca009..fd9e66ef 100644 --- a/variables.tf +++ b/variables.tf @@ -91,7 +91,7 @@ variable "template_annotations" { variable "container_concurrency" { type = number description = "Concurrent request limits to the service" - default = 0 + default = 80 } variable "timeout_seconds" { @@ -125,7 +125,9 @@ variable "volumes" { variable "limits" { type = map(string) description = "Resource limits to the container" - default = {} + default = { + "cpu" = "1000m" + "memory" = "512Mi" } variable "requests" { type = map(string) From d2de7f7d1734ee48b891eda84d5a609b3597f50d Mon Sep 17 00:00:00 2001 From: Jonathan Greger <43762185+jmgreger@users.noreply.github.com> Date: Thu, 7 Apr 2022 11:55:22 -0400 Subject: [PATCH 2/8] Update README.md Update defaults to match new variables file --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cefd9c2..695092e9 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ module "cloud_run" { | argument | Arguments passed to the ENTRYPOINT command, include these only if image entrypoint needs arguments | `list(string)` | `[]` | no | | certificate\_mode | The mode of the certificate (NONE or AUTOMATIC) | `string` | `"NONE"` | no | | container\_command | Leave blank to use the ENTRYPOINT command defined in the container image, include these only if image entrypoint should be overwritten | `list(string)` | `[]` | no | -| container\_concurrency | Concurrent request limits to the service | `number` | `0` | no | +| container\_concurrency | Concurrent request limits to the service | `number` | `80` | no | | domain\_map\_annotations | Annotations to the domain map | `map(string)` | `{}` | no | | domain\_map\_labels | A set of key/value label pairs to assign to the Domain mapping | `map(string)` | `{}` | no | | env\_secret\_vars | [Beta] Environment variables (Secret Manager) |
list(object({
name = string
value_from = set(object({
secret_key_ref = map(string)
}))
}))
| `[]` | no | @@ -55,7 +55,7 @@ module "cloud_run" { | members | Users/SAs to be given invoker access to the service | `list(string)` | `[]` | no | | ports | Port which the container listens to (http1 or h2c) |
object({
name = string
port = number
})
|
{
"name": "http1",
"port": 8080
}
| no | | project\_id | The project ID to deploy to | `string` | n/a | yes | -| requests | Resource requests to the container | `map(string)` | `{}` | no | +| requests | Resource requests to the container | `map(string)` |
{
"cpu" = "1000m",
"memory" = "512Mi"
}
| no | | service\_account\_email | Service Account email needed for the service | `string` | `""` | no | | service\_annotations | Annotations to the service. Acceptable values all, internal, internal-and-cloud-load-balancing | `map(string)` |
{
"run.googleapis.com/ingress": "all"
}
| no | | service\_labels | A set of key/value label pairs to assign to the service | `map(string)` | `{}` | no | From e871f1d5f2f5b61a765aebc26e65870d9e0e428a Mon Sep 17 00:00:00 2001 From: Jonathan Greger <43762185+jmgreger@users.noreply.github.com> Date: Thu, 7 Apr 2022 12:01:19 -0400 Subject: [PATCH 3/8] Fixed limits variable block --- variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/variables.tf b/variables.tf index fd9e66ef..6b9d3586 100644 --- a/variables.tf +++ b/variables.tf @@ -128,6 +128,7 @@ variable "limits" { default = { "cpu" = "1000m" "memory" = "512Mi" + } } variable "requests" { type = map(string) From 578f4ad9389a30c7e834fe5dc3163ce45dbe1f76 Mon Sep 17 00:00:00 2001 From: Jonathan Greger <43762185+jmgreger@users.noreply.github.com> Date: Thu, 7 Apr 2022 12:27:25 -0400 Subject: [PATCH 4/8] variables.tf formatting --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 6b9d3586..7da7aefa 100644 --- a/variables.tf +++ b/variables.tf @@ -126,7 +126,7 @@ variable "limits" { type = map(string) description = "Resource limits to the container" default = { - "cpu" = "1000m" + "cpu" = "1000m" "memory" = "512Mi" } } From 8f4439d99b752887c924e9835e9e27b839bcea59 Mon Sep 17 00:00:00 2001 From: Jonathan Greger <43762185+jmgreger@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:43:01 -0400 Subject: [PATCH 5/8] terraform fmt --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 7da7aefa..e133a6f0 100644 --- a/variables.tf +++ b/variables.tf @@ -125,7 +125,7 @@ variable "volumes" { variable "limits" { type = map(string) description = "Resource limits to the container" - default = { + default = { "cpu" = "1000m" "memory" = "512Mi" } From 4bcc110df66540087263fcf9b6caa90559898040 Mon Sep 17 00:00:00 2001 From: Jonathan Greger Date: Tue, 19 Apr 2022 18:53:17 +0000 Subject: [PATCH 6/8] generated docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 695092e9..4bbfd508 100644 --- a/README.md +++ b/README.md @@ -50,12 +50,12 @@ module "cloud_run" { | force\_override | Option to force override existing mapping | `bool` | `false` | no | | generate\_revision\_name | Option to enable revision name generation | `bool` | `true` | no | | image | GCR hosted image URL to deploy | `string` | n/a | yes | -| limits | Resource limits to the container | `map(string)` | `{}` | no | +| limits | Resource limits to the container | `map(string)` |
{
"cpu": "1000m",
"memory": "512Mi"
}
| no | | location | Cloud Run service deployment location | `string` | n/a | yes | | members | Users/SAs to be given invoker access to the service | `list(string)` | `[]` | no | | ports | Port which the container listens to (http1 or h2c) |
object({
name = string
port = number
})
|
{
"name": "http1",
"port": 8080
}
| no | | project\_id | The project ID to deploy to | `string` | n/a | yes | -| requests | Resource requests to the container | `map(string)` |
{
"cpu" = "1000m",
"memory" = "512Mi"
}
| no | +| requests | Resource requests to the container | `map(string)` | `{}` | no | | service\_account\_email | Service Account email needed for the service | `string` | `""` | no | | service\_annotations | Annotations to the service. Acceptable values all, internal, internal-and-cloud-load-balancing | `map(string)` |
{
"run.googleapis.com/ingress": "all"
}
| no | | service\_labels | A set of key/value label pairs to assign to the service | `map(string)` | `{}` | no | From 2647251e303c16e1638aaf419b6a7c4c8156655c Mon Sep 17 00:00:00 2001 From: Jonathan Greger Date: Fri, 13 May 2022 20:01:50 +0000 Subject: [PATCH 7/8] updates variables to null --- variables.tf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/variables.tf b/variables.tf index e133a6f0..5a4f5504 100644 --- a/variables.tf +++ b/variables.tf @@ -91,7 +91,7 @@ variable "template_annotations" { variable "container_concurrency" { type = number description = "Concurrent request limits to the service" - default = 80 + default = null } variable "timeout_seconds" { @@ -125,10 +125,7 @@ variable "volumes" { variable "limits" { type = map(string) description = "Resource limits to the container" - default = { - "cpu" = "1000m" - "memory" = "512Mi" - } + default = null } variable "requests" { type = map(string) From c2d7e8285ee140dc1f92341eba106281ade0b4a0 Mon Sep 17 00:00:00 2001 From: Jonathan Greger Date: Fri, 13 May 2022 20:05:01 +0000 Subject: [PATCH 8/8] generated_docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bbfd508..d4052f99 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ module "cloud_run" { | argument | Arguments passed to the ENTRYPOINT command, include these only if image entrypoint needs arguments | `list(string)` | `[]` | no | | certificate\_mode | The mode of the certificate (NONE or AUTOMATIC) | `string` | `"NONE"` | no | | container\_command | Leave blank to use the ENTRYPOINT command defined in the container image, include these only if image entrypoint should be overwritten | `list(string)` | `[]` | no | -| container\_concurrency | Concurrent request limits to the service | `number` | `80` | no | +| container\_concurrency | Concurrent request limits to the service | `number` | `null` | no | | domain\_map\_annotations | Annotations to the domain map | `map(string)` | `{}` | no | | domain\_map\_labels | A set of key/value label pairs to assign to the Domain mapping | `map(string)` | `{}` | no | | env\_secret\_vars | [Beta] Environment variables (Secret Manager) |
list(object({
name = string
value_from = set(object({
secret_key_ref = map(string)
}))
}))
| `[]` | no | @@ -50,7 +50,7 @@ module "cloud_run" { | force\_override | Option to force override existing mapping | `bool` | `false` | no | | generate\_revision\_name | Option to enable revision name generation | `bool` | `true` | no | | image | GCR hosted image URL to deploy | `string` | n/a | yes | -| limits | Resource limits to the container | `map(string)` |
{
"cpu": "1000m",
"memory": "512Mi"
}
| no | +| limits | Resource limits to the container | `map(string)` | `null` | no | | location | Cloud Run service deployment location | `string` | n/a | yes | | members | Users/SAs to be given invoker access to the service | `list(string)` | `[]` | no | | ports | Port which the container listens to (http1 or h2c) |
object({
name = string
port = number
})
|
{
"name": "http1",
"port": 8080
}
| no |