Adding container scaling settings
Written by
Updated at October 17, 2024
You can set the number of provisioned instances.
Downtime of provisioned instances and runtime of the container in them are charged additionally.
The scaling settings must be within the quotas.
Note
Scaling settings take effect within five minutes after being configured.
Management console
CLI
API
- In the management console
, select the folder with your container. - Select Serverless Containers.
- Select the container.
- Go to the Editor tab.
- Under Settings, specify the number of provisioned instances.
- Click Create revision.
To add scaling settings for a container, run this command:
yc serverless container revision deploy \
--container-id <container_ID> \
--image <Docker_image_URL> \
--cores 1 \
--memory 1GB \
--execution-timeout 3s \
--service-account-id <service_account_ID> \
--min-instances 1
Where:
--container-id
: Container ID. To find out the ID, get a list of containers.--cores
: Number of cores available to the container.--memory
: Required memory. The default value is 128 MB.--execution-timeout
: Timeout The default value is 3 seconds.--service-account-id
: ID of the service account authorized to download the image.--min-instances
: Number of ready-to-go instances.
Result:
id: bbajn5q2d74c********
container_id: bba3fva6ka5g********
created_at: "2021-07-09T15:04:55.135Z"
image:
image_url: cr.yandex/crpd3cicopk7********/test-container:latest
image_digest: sha256:de8e1dce7ceceeafaae122f7670084a1119c961cd9ea1795eae92bd********
resources:
memory: "1073741824"
cores: "1"
execution_timeout: 3s
service_account_id: ajeqnasj95o7********
status: ACTIVE
provision_policy:
min_instances: "1"
To add container scaling settings, use the deployRevision REST API method for the Container resource or the ContainerService/DeployRevision gRPC API call.