This is my default app.yaml file:
runtime: custom
env: flex
service: api
runtime_config:
jdk: openjdk8
handlers:
- url: /.*
script: this field is required, but ignored
automatic_scaling:
min_num_instances: 1
max_num_instances: 10
When I deploy with my updated app.yaml file, the file is just reset to the previous, default one. This is what I try:
runtime: custom
env: flex
service: api
runtime_config:
jdk: openjdk8
handlers:
- url: /.*
script: this field is required, but ignored
automatic_scaling:
max_num_instances: 1
resources:
core: 1
UPDATED BELOW:
OK so I got this one above to work now. It seemed the api-service had two app.yaml files and I had to change in both. This now has a config on the GCP web interface that looks like the one I deployed: min 1 and max 3. BUT, even so, it sometimes creates 4-5 instances. :S
NOW, to my other application, scheduler, this is what I put in the app.yaml file:
runtime: java8
service: 'scheduler'
inbound_services:
- warmup
derived_file_type:
- java_precompiled
threadsafe: True
auto_id_policy: default
api_version: '1.0'
handlers:
- url: (/.*)
static_files: __static__\1
upload: __NOT_USED__
require_matching_file: True
login: optional
secure: optional
- url: /
script: unused
login: optional
secure: optional
- url: /.*/
script: unused
login: optional
secure: optional
- url: /_ah/.*
script: unused
login: optional
secure: optional
- url: /cron/v1/simulations
script: unused
login: optional
secure: optional
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 1
volumes:
- name: ramdisk1
volume_type: tmpfs
size_gb: 0.5
automatic_scaling:
min_num_instances: 1
max_num_instances: 2
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.6
And when it's deployed, on GCP its config looks like this:
runtime: java8
api_version: '1.0'
env: standard
threadsafe: true
instance_class: F1
inbound_services:
- warmup
handlers:
- url: '(/.*)'
application_readable: false
static_files: "__static__\\1"
require_matching_file: true
upload: __NOT_USED__
- url: /
script: unused
- url: '/.*/'
script: unused
- url: '/_ah/.*'
script: unused
- url: /cron/v1/simulations
script: unused
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: automatic
max_pending_latency: automatic
And here's a screenshot of the result:
Very confusing.