Skip to content

Commit e1533a3

Browse files
authored
fix the cloud run annotation (#94)
1 parent c145b64 commit e1533a3

1 file changed

Lines changed: 31 additions & 24 deletions

File tree

tf/cloud-run-collector/cloud-run-collector.tf

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,44 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
resource "google_cloud_run_v2_service" "default" {
16-
name = "e2etest-${terraform.workspace}"
17-
location = "us-central1"
18-
deletion_protection = false
15+
resource "google_cloud_run_service" "default" {
16+
name = "e2etest-${terraform.workspace}"
17+
location = "us-central1"
1918

2019
timeouts {
2120
create = "6m"
2221
}
2322

24-
template {
25-
scaling {
26-
max_instance_count = 1
23+
metadata {
24+
annotations = {
25+
"run.googleapis.com/ingress" = "internal-and-cloud-load-balancing"
2726
}
28-
containers {
29-
image = var.image
30-
args = ["--config=env:OTEL_CONFIG"]
31-
ports {
32-
container_port = 8888
33-
}
34-
resources {
35-
# If true, garbage-collect CPU when once a request finishes
36-
cpu_idle = false
37-
}
38-
env {
39-
name = "PROJECT_ID"
40-
value = var.project_id
27+
}
28+
29+
template {
30+
metadata {
31+
annotations = {
32+
"autoscaling.knative.dev/maxScale" = "1"
4133
}
42-
env {
43-
name = "OTEL_CONFIG"
44-
value = jsonencode(module.otel_config.config)
34+
}
35+
36+
spec {
37+
containers {
38+
image = var.image
39+
args = ["--config=env:OTEL_CONFIG"]
40+
41+
ports {
42+
container_port = 8888
43+
}
44+
45+
env {
46+
name = "PROJECT_ID"
47+
value = var.project_id
48+
}
49+
env {
50+
name = "OTEL_CONFIG"
51+
value = jsonencode(module.otel_config.config)
52+
}
4553
}
4654
}
4755
}
@@ -55,4 +63,3 @@ module "otel_config" {
5563
variable "image" {
5664
type = string
5765
}
58-

0 commit comments

Comments
 (0)