# ReplicaSet

ReplicaSetReplicaSet ensures that a specified number of pod replicas are running at any given time.apiVersion: apps/v1import "k8s.io/api/apps/v1"ReplicaSetReplicaSet ensures that a specified number of pod replicas are running at any given time.apiVersion: apps/v1kind: ReplicaSetmetadata (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#metadataspec (ReplicaSetSpec)Spec defines the specification of the desired behavior of the ReplicaSet. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (ReplicaSetStatus)Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusReplicaSetSpecReplicaSetSpec is the specification of a ReplicaSet.selector (LabelSelector), requiredSelector 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-selectorstemplate (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/replicaset/#pod-templatereplicas (int32)Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicasetminReadySeconds (int32)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)ReplicaSetStatusReplicaSetStatus represents the current status of a ReplicaSet.replicas (int32), requiredReplicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicasetavailableReplicas (int32)The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.readyReplicas (int32)The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.terminatingReplicas (int32)The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.fullyLabeledReplicas (int32)The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.conditions ([]ReplicaSetCondition)Patch strategy: merge on key typeMap: unique values on key type will be kept during a mergeRepresents the latest available observations of a replica set's current state.ReplicaSetCondition describes the state of a replica set at a certain point.conditions.status (string), requiredStatus of the condition, one of True, False, Unknown.conditions.type (string), requiredType of replica set condition.conditions.lastTransitionTime (Time)The last time the condition transitioned from one status to another.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.conditions.message (string)A human readable message indicating details about the transition.conditions.reason (string)The reason for the condition's last transition.observedGeneration (int64)ObservedGeneration reflects the generation of the most recently observed ReplicaSet.ReplicaSetListReplicaSetList is a collection of ReplicaSets.apiVersion: apps/v1kind: ReplicaSetListmetadata (ListMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsitems ([]ReplicaSet), requiredList of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicasetOperationsget read the specified ReplicaSetHTTP RequestGET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}Parametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (ReplicaSet): OK401: Unauthorizedget read status of the specified ReplicaSetHTTP RequestGET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/statusParametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (ReplicaSet): OK401: Unauthorizedlist list or watch objects of kind ReplicaSetHTTP RequestGET /apis/apps/v1/namespaces/{namespace}/replicasetsParametersnamespace (in path): string, requirednamespaceallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (ReplicaSetList): OK401: Unauthorizedlist list or watch objects of kind ReplicaSetHTTP RequestGET /apis/apps/v1/replicasetsParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (ReplicaSetList): OK401: Unauthorizedcreate create a ReplicaSetHTTP RequestPOST /apis/apps/v1/namespaces/{namespace}/replicasetsParametersnamespace (in path): string, requirednamespacebody: ReplicaSet, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (ReplicaSet): OK201 (ReplicaSet): Created202 (ReplicaSet): Accepted401: Unauthorizedupdate replace the specified ReplicaSetHTTP RequestPUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}Parametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacebody: ReplicaSet, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (ReplicaSet): OK201 (ReplicaSet): Created401: Unauthorizedupdate replace status of the specified ReplicaSetHTTP RequestPUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/statusParametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacebody: ReplicaSet, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (ReplicaSet): OK201 (ReplicaSet): Created401: Unauthorizedpatch partially update the specified ReplicaSetHTTP RequestPATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}Parametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (ReplicaSet): OK201 (ReplicaSet): Created401: Unauthorizedpatch partially update status of the specified ReplicaSetHTTP RequestPATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/statusParametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (ReplicaSet): OK201 (ReplicaSet): Created401: Unauthorizeddelete delete a ReplicaSetHTTP RequestDELETE /apis/apps/v1/namespaces/{namespace}/replicasets/{name}Parametersname (in path): string, requiredname of the ReplicaSetnamespace (in path): string, requirednamespacebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of ReplicaSetHTTP RequestDELETE /apis/apps/v1/namespaces/{namespace}/replicasetsParametersnamespace (in path): string, requirednamespacebody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.