1

After a hefting bill from leaving my project turn on for 7 days in GCloud i decided to look for an explanation. I found that app.yaml wasnt configure so that it uses the basic minimum spec. So i found this solution
I am trying to deploy asp .net core app into GAE using gcloud app deploy but i am facing this issue! What i am doing wrong here as i think i am following the correct syntax as in the google docs https://cloud.google.com/appengine/docs/flexible/dotnet/reference/app-yaml

enter image description here

app.yaml

runtime: aspnetcore
env: flex
automatic_scaling:
  min_num_instances: 0
  max_num_instances: 1
  cool_down_period_sec: 180
  cpu_utilization:
    target_utilization: 0.6
  target_concurrent_requests: 100
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

I tried this version from Pricing of Google App Engine Flexible env, a $500 lesson but i manage to get it to work on the first try but after following deployment i kept getting the same error above.

The version that work the first time round

runtime: aspnetcore
env: flex
instance_class: F1
automatic_scaling:
  max_instances: 1
  min_instances: 0
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
Photonic
  • 1,316
  • 19
  • 31
  • 1
    Are you saying the error you posted is from the value of your app.yaml where you have the parameter - ```max_num_instances```? I ask because your error message talks about ```max_instances``` but you don't have that in what you posted as your current ```app.yaml``` file. Also, if you're trying to cut down on the hefty bill you received, I'm curious as to why you want to have up to 15 instances running – NoCommandLine Feb 15 '22 at 23:47
  • ahh my bad, let me correct that – Photonic Feb 17 '22 at 13:45
  • @NoCommandLine No matter what i use as a syntax ```max_instances``` or ```max_num_instances``` the error will be the same – Photonic Feb 17 '22 at 13:50

2 Answers2

1

The issue is due to the min_num_instances, since in Flex environment there can't be zero instances, as mentioned in the documentation:

The standard environment can scale from zero instances up to thousands very quickly. In contrast, the flexible environment must have at least one instance running for each active version

Changing the value of the parameter to greater than zero should help to fix the error

Emmanuel
  • 1,436
  • 1
  • 11
  • 17
0

This configuration seems to work in the end and i found out that i cannot set min_num_instances to 0

runtime: aspnetcore
env: flex
instance_class: F1
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 1
  cool_down_period_sec: 180
  cpu_utilization:
    target_utilization: 0.6
  target_concurrent_requests: 100
inbound_services:
- warmup
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
Photonic
  • 1,316
  • 19
  • 31