Chapter 16. ReplicaSet [apps/v1]


Description
ReplicaSet ensures that a specified number of pod replicas are running at any given time.
Type
object

16.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

If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

spec

object

ReplicaSetSpec is the specification of a ReplicaSet.

status

object

ReplicaSetStatus represents the current status of a ReplicaSet.

16.1.1. .spec

Description
ReplicaSetSpec is the specification of a ReplicaSet.
Type
object
Required
  • selector
PropertyTypeDescription

minReadySeconds

integer

Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

replicas

integer

Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller

selector

LabelSelector

Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template’s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

template

PodTemplateSpec

Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template

16.1.2. .status

Description
ReplicaSetStatus represents the current status of a ReplicaSet.
Type
object
Required
  • replicas
PropertyTypeDescription

availableReplicas

integer

The number of available replicas (ready for at least minReadySeconds) for this replica set.

conditions

array

Represents the latest available observations of a replica set’s current state.

conditions[]

object

ReplicaSetCondition describes the state of a replica set at a certain point.

fullyLabeledReplicas

integer

The number of pods that have labels matching the labels of the pod template of the replicaset.

observedGeneration

integer

ObservedGeneration reflects the generation of the most recently observed ReplicaSet.

readyReplicas

integer

readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.

replicas

integer

Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller

16.1.3. .status.conditions

Description
Represents the latest available observations of a replica set’s current state.
Type
array

16.1.4. .status.conditions[]

Description
ReplicaSetCondition describes the state of a replica set at a certain point.
Type
object
Required
  • type
  • status
PropertyTypeDescription

lastTransitionTime

Time

The last time the condition transitioned from one status to another.

message

string

A human readable message indicating details about the transition.

reason

string

The reason for the condition’s last transition.

status

string

Status of the condition, one of True, False, Unknown.

type

string

Type of replica set condition.

16.2. API endpoints

The following API endpoints are available:

  • /apis/apps/v1/replicasets

    • GET: list or watch objects of kind ReplicaSet
  • /apis/apps/v1/watch/replicasets

    • GET: watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/apps/v1/namespaces/{namespace}/replicasets

    • DELETE: delete collection of ReplicaSet
    • GET: list or watch objects of kind ReplicaSet
    • POST: create a ReplicaSet
  • /apis/apps/v1/watch/namespaces/{namespace}/replicasets

    • GET: watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

    • DELETE: delete a ReplicaSet
    • GET: read the specified ReplicaSet
    • PATCH: partially update the specified ReplicaSet
    • PUT: replace the specified ReplicaSet
  • /apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}

    • GET: watch changes to an object of kind ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
  • /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

    • GET: read status of the specified ReplicaSet
    • PATCH: partially update status of the specified ReplicaSet
    • PUT: replace status of the specified ReplicaSet

16.2.1. /apis/apps/v1/replicasets

HTTP method
GET
Description
list or watch objects of kind ReplicaSet
Table 16.1. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSetList schema

401 - Unauthorized

Empty

16.2.2. /apis/apps/v1/watch/replicasets

HTTP method
GET
Description
watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.
Table 16.2. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

16.2.3. /apis/apps/v1/namespaces/{namespace}/replicasets

HTTP method
DELETE
Description
delete collection of ReplicaSet
Table 16.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

Table 16.4. HTTP responses
HTTP codeReponse body

200 - OK

Status schema

401 - Unauthorized

Empty

HTTP method
GET
Description
list or watch objects of kind ReplicaSet
Table 16.5. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSetList schema

401 - Unauthorized

Empty

HTTP method
POST
Description
create a ReplicaSet
Table 16.6. 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 16.7. Body parameters
ParameterTypeDescription

body

ReplicaSet schema

 
Table 16.8. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

201 - Created

ReplicaSet schema

202 - Accepted

ReplicaSet schema

401 - Unauthorized

Empty

16.2.4. /apis/apps/v1/watch/namespaces/{namespace}/replicasets

HTTP method
GET
Description
watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.
Table 16.9. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

16.2.5. /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

Table 16.10. Global path parameters
ParameterTypeDescription

name

string

name of the ReplicaSet

HTTP method
DELETE
Description
delete a ReplicaSet
Table 16.11. 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

Table 16.12. HTTP responses
HTTP codeReponse body

200 - OK

Status schema

202 - Accepted

Status schema

401 - Unauthorized

Empty

HTTP method
GET
Description
read the specified ReplicaSet
Table 16.13. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update the specified ReplicaSet
Table 16.14. 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 16.15. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

201 - Created

ReplicaSet schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace the specified ReplicaSet
Table 16.16. 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 16.17. Body parameters
ParameterTypeDescription

body

ReplicaSet schema

 
Table 16.18. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

201 - Created

ReplicaSet schema

401 - Unauthorized

Empty

16.2.6. /apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}

Table 16.19. Global path parameters
ParameterTypeDescription

name

string

name of the ReplicaSet

HTTP method
GET
Description
watch changes to an object of kind ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
Table 16.20. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

16.2.7. /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

Table 16.21. Global path parameters
ParameterTypeDescription

name

string

name of the ReplicaSet

HTTP method
GET
Description
read status of the specified ReplicaSet
Table 16.22. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update status of the specified ReplicaSet
Table 16.23. 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 16.24. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

201 - Created

ReplicaSet schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace status of the specified ReplicaSet
Table 16.25. 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 16.26. Body parameters
ParameterTypeDescription

body

ReplicaSet schema

 
Table 16.27. HTTP responses
HTTP codeReponse body

200 - OK

ReplicaSet schema

201 - Created

ReplicaSet 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.