Search

Chapter 5. Scale [autoscaling/v1]

download PDF
Description
Scale represents a scaling request for a resource.
Type
object

5.1. Specification

PropertyTypeDescription

apiVersion

string

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

string

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadata

ObjectMeta

Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.

spec

object

ScaleSpec describes the attributes of a scale subresource.

status

object

ScaleStatus represents the current status of a scale subresource.

5.1.1. .spec

Description
ScaleSpec describes the attributes of a scale subresource.
Type
object
PropertyTypeDescription

replicas

integer

replicas is the desired number of instances for the scaled object.

5.1.2. .status

Description
ScaleStatus represents the current status of a scale subresource.
Type
object
Required
  • replicas
PropertyTypeDescription

replicas

integer

replicas is the actual number of observed instances of the scaled object.

selector

string

selector is the label query over pods that should match the replicas count. This is same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

5.2. API endpoints

The following API endpoints are available:

  • /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale

    • GET: read scale of the specified Deployment
    • PATCH: partially update scale of the specified Deployment
    • PUT: replace scale of the specified Deployment
  • /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale

    • GET: read scale of the specified ReplicaSet
    • PATCH: partially update scale of the specified ReplicaSet
    • PUT: replace scale of the specified ReplicaSet
  • /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale

    • GET: read scale of the specified StatefulSet
    • PATCH: partially update scale of the specified StatefulSet
    • PUT: replace scale of the specified StatefulSet
  • /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale

    • GET: read scale of the specified ReplicationController
    • PATCH: partially update scale of the specified ReplicationController
    • PUT: replace scale of the specified ReplicationController

5.2.1. /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale

Table 5.1. Global path parameters
ParameterTypeDescription

name

string

name of the Scale

HTTP method
GET
Description
read scale of the specified Deployment
Table 5.2. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update scale of the specified Deployment
Table 5.3. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.4. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace scale of the specified Deployment
Table 5.5. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.6. Body parameters
ParameterTypeDescription

body

Scale schema

 
Table 5.7. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

5.2.2. /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale

Table 5.8. Global path parameters
ParameterTypeDescription

name

string

name of the Scale

HTTP method
GET
Description
read scale of the specified ReplicaSet
Table 5.9. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update scale of the specified ReplicaSet
Table 5.10. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.11. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace scale of the specified ReplicaSet
Table 5.12. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.13. Body parameters
ParameterTypeDescription

body

Scale schema

 
Table 5.14. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

5.2.3. /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale

Table 5.15. Global path parameters
ParameterTypeDescription

name

string

name of the Scale

HTTP method
GET
Description
read scale of the specified StatefulSet
Table 5.16. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update scale of the specified StatefulSet
Table 5.17. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.18. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace scale of the specified StatefulSet
Table 5.19. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.20. Body parameters
ParameterTypeDescription

body

Scale schema

 
Table 5.21. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

5.2.4. /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale

Table 5.22. Global path parameters
ParameterTypeDescription

name

string

name of the Scale

HTTP method
GET
Description
read scale of the specified ReplicationController
Table 5.23. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update scale of the specified ReplicationController
Table 5.24. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.25. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace scale of the specified ReplicationController
Table 5.26. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 5.27. Body parameters
ParameterTypeDescription

body

Scale schema

 
Table 5.28. HTTP responses
HTTP codeReponse body

200 - OK

Scale schema

201 - Created

Scale schema

401 - Unauthorized

Empty

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.