mirror of https://github.com/openkruise/charts.git
1060 lines
55 KiB
YAML
1060 lines
55 KiB
YAML
{{- if .Values.crds.managed }}
|
|
|
|
---
|
|
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
annotations:
|
|
controller-gen.kubebuilder.io/version: v0.14.0
|
|
{{- if .Values.externalCerts.annotations }}
|
|
{{ toYaml .Values.externalCerts.annotations | indent 4 }}
|
|
{{- end }}
|
|
name: statefulsets.apps.kruise.io
|
|
spec:
|
|
conversion:
|
|
strategy: Webhook
|
|
webhook:
|
|
clientConfig:
|
|
service:
|
|
name: kruise-webhook-service
|
|
namespace: kruise-system
|
|
path: /convert
|
|
conversionReviewVersions:
|
|
- v1
|
|
- v1beta1
|
|
group: apps.kruise.io
|
|
names:
|
|
kind: StatefulSet
|
|
listKind: StatefulSetList
|
|
plural: statefulsets
|
|
shortNames:
|
|
- sts
|
|
- asts
|
|
singular: statefulset
|
|
scope: Namespaced
|
|
versions:
|
|
- additionalPrinterColumns:
|
|
- description: The desired number of pods.
|
|
jsonPath: .spec.replicas
|
|
name: DESIRED
|
|
type: integer
|
|
- description: The number of currently all pods.
|
|
jsonPath: .status.replicas
|
|
name: CURRENT
|
|
type: integer
|
|
- description: The number of pods updated.
|
|
jsonPath: .status.updatedReplicas
|
|
name: UPDATED
|
|
type: integer
|
|
- description: The number of pods ready.
|
|
jsonPath: .status.readyReplicas
|
|
name: READY
|
|
type: integer
|
|
- description: CreationTimestamp is a timestamp representing the server time when
|
|
this object was created. It is not guaranteed to be set in happens-before
|
|
order across separate operations. Clients may not set this value. It is represented
|
|
in RFC3339 form and is in UTC.
|
|
jsonPath: .metadata.creationTimestamp
|
|
name: AGE
|
|
type: date
|
|
- description: The containers of currently advanced statefulset.
|
|
jsonPath: .spec.template.spec.containers[*].name
|
|
name: CONTAINERS
|
|
priority: 1
|
|
type: string
|
|
- description: The images of currently advanced statefulset.
|
|
jsonPath: .spec.template.spec.containers[*].image
|
|
name: IMAGES
|
|
priority: 1
|
|
type: string
|
|
name: v1alpha1
|
|
schema:
|
|
openAPIV3Schema:
|
|
description: StatefulSet is the Schema for the statefulsets API
|
|
properties:
|
|
apiVersion:
|
|
description: |-
|
|
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
|
|
type: string
|
|
kind:
|
|
description: |-
|
|
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
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
spec:
|
|
description: StatefulSetSpec defines the desired state of StatefulSet
|
|
properties:
|
|
podManagementPolicy:
|
|
description: |-
|
|
podManagementPolicy controls how pods are created during initial scale up,
|
|
when replacing pods on nodes, or when scaling down. The default policy is
|
|
`OrderedReady`, where pods are created in increasing order (pod-0, then
|
|
pod-1, etc) and the controller will wait until each pod is ready before
|
|
continuing. When scaling down, the pods are removed in the opposite order.
|
|
The alternative policy is `Parallel` which will create pods in parallel
|
|
to match the desired scale without waiting, and on scale down will delete
|
|
all pods at once.
|
|
type: string
|
|
replicas:
|
|
description: |-
|
|
replicas is the desired number of replicas of the given Template.
|
|
These are replicas in the sense that they are instantiations of the
|
|
same Template, but individual replicas also have a consistent identity.
|
|
If unspecified, defaults to 1.
|
|
TODO: Consider a rename of this field.
|
|
format: int32
|
|
type: integer
|
|
revisionHistoryLimit:
|
|
description: |-
|
|
revisionHistoryLimit is the maximum number of revisions that will
|
|
be maintained in the StatefulSet's revision history. The revision history
|
|
consists of all revisions not represented by a currently applied
|
|
StatefulSetSpec version. The default value is 10.
|
|
format: int32
|
|
type: integer
|
|
selector:
|
|
description: |-
|
|
selector is a label query over pods that should match the replica count.
|
|
It must match the pod template's labels.
|
|
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
|
properties:
|
|
matchExpressions:
|
|
description: matchExpressions is a list of label selector requirements.
|
|
The requirements are ANDed.
|
|
items:
|
|
description: |-
|
|
A label selector requirement is a selector that contains values, a key, and an operator that
|
|
relates the key and values.
|
|
properties:
|
|
key:
|
|
description: key is the label key that the selector applies
|
|
to.
|
|
type: string
|
|
operator:
|
|
description: |-
|
|
operator represents a key's relationship to a set of values.
|
|
Valid operators are In, NotIn, Exists and DoesNotExist.
|
|
type: string
|
|
values:
|
|
description: |-
|
|
values is an array of string values. If the operator is In or NotIn,
|
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
|
the values array must be empty. This array is replaced during a strategic
|
|
merge patch.
|
|
items:
|
|
type: string
|
|
type: array
|
|
required:
|
|
- key
|
|
- operator
|
|
type: object
|
|
type: array
|
|
matchLabels:
|
|
additionalProperties:
|
|
type: string
|
|
description: |-
|
|
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
|
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
|
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
|
type: object
|
|
type: object
|
|
x-kubernetes-map-type: atomic
|
|
serviceName:
|
|
description: |-
|
|
serviceName is the name of the service that governs this StatefulSet.
|
|
This service must exist before the StatefulSet, and is responsible for
|
|
the network identity of the set. Pods get DNS/hostnames that follow the
|
|
pattern: pod-specific-string.serviceName.default.svc.cluster.local
|
|
where "pod-specific-string" is managed by the StatefulSet controller.
|
|
type: string
|
|
template:
|
|
description: |-
|
|
template is the object that describes the pod that will be created if
|
|
insufficient replicas are detected. Each pod stamped out by the StatefulSet
|
|
will fulfill this Template, but have a unique identity from the rest
|
|
of the StatefulSet.
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
updateStrategy:
|
|
description: |-
|
|
updateStrategy indicates the StatefulSetUpdateStrategy that will be
|
|
employed to update Pods in the StatefulSet when a revision is made to
|
|
Template.
|
|
properties:
|
|
rollingUpdate:
|
|
description: RollingUpdate is used to communicate parameters when
|
|
Type is RollingUpdateStatefulSetStrategyType.
|
|
properties:
|
|
inPlaceUpdateStrategy:
|
|
description: InPlaceUpdateStrategy contains strategies for
|
|
in-place update.
|
|
properties:
|
|
gracePeriodSeconds:
|
|
description: |-
|
|
GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec
|
|
when in-place update a Pod.
|
|
format: int32
|
|
type: integer
|
|
type: object
|
|
maxUnavailable:
|
|
anyOf:
|
|
- type: integer
|
|
- type: string
|
|
description: |-
|
|
The maximum number of pods that can be unavailable during the update.
|
|
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
|
Absolute number is calculated from percentage by rounding down.
|
|
Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy.
|
|
Defaults to 1.
|
|
x-kubernetes-int-or-string: true
|
|
minReadySeconds:
|
|
description: |-
|
|
MinReadySeconds indicates how long will the pod be considered ready after it's updated.
|
|
MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy.
|
|
It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady.
|
|
Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy.
|
|
Default value is 0, max is 300.
|
|
format: int32
|
|
type: integer
|
|
partition:
|
|
description: |-
|
|
Partition indicates the ordinal at which the StatefulSet should be partitioned by default.
|
|
But if unorderedUpdate has been set:
|
|
- Partition indicates the number of pods with non-updated revisions when rolling update.
|
|
- It means controller will update $(replicas - partition) number of pod.
|
|
Default value is 0.
|
|
format: int32
|
|
type: integer
|
|
paused:
|
|
description: |-
|
|
Paused indicates that the StatefulSet is paused.
|
|
Default value is false
|
|
type: boolean
|
|
podUpdatePolicy:
|
|
description: |-
|
|
PodUpdatePolicy indicates how pods should be updated
|
|
Default value is "ReCreate"
|
|
type: string
|
|
unorderedUpdate:
|
|
description: |-
|
|
UnorderedUpdate contains strategies for non-ordered update.
|
|
If it is not nil, pods will be updated with non-ordered sequence.
|
|
Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy
|
|
properties:
|
|
priorityStrategy:
|
|
description: |-
|
|
Priorities are the rules for calculating the priority of updating pods.
|
|
Each pod to be updated, will pass through these terms and get a sum of weights.
|
|
properties:
|
|
orderPriority:
|
|
description: |-
|
|
Order priority terms, pods will be sorted by the value of orderedKey.
|
|
For example:
|
|
```
|
|
orderPriority:
|
|
- orderedKey: key1
|
|
- orderedKey: key2
|
|
```
|
|
First, all pods which have key1 in labels will be sorted by the value of key1.
|
|
Then, the left pods which have no key1 but have key2 in labels will be sorted by
|
|
the value of key2 and put behind those pods have key1.
|
|
items:
|
|
description: UpdatePriorityOrderTerm defines order
|
|
priority.
|
|
properties:
|
|
orderedKey:
|
|
description: |-
|
|
Calculate priority by value of this key.
|
|
Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value,
|
|
such as getting 5 in value '5', getting 10 in value 'sts-10'.
|
|
type: string
|
|
required:
|
|
- orderedKey
|
|
type: object
|
|
type: array
|
|
weightPriority:
|
|
description: Weight priority terms, pods will be sorted
|
|
by the sum of all terms weight.
|
|
items:
|
|
description: UpdatePriorityWeightTerm defines weight
|
|
priority.
|
|
properties:
|
|
matchSelector:
|
|
description: MatchSelector is used to select
|
|
by pod's labels.
|
|
properties:
|
|
matchExpressions:
|
|
description: matchExpressions is a list
|
|
of label selector requirements. The requirements
|
|
are ANDed.
|
|
items:
|
|
description: |-
|
|
A label selector requirement is a selector that contains values, a key, and an operator that
|
|
relates the key and values.
|
|
properties:
|
|
key:
|
|
description: key is the label key
|
|
that the selector applies to.
|
|
type: string
|
|
operator:
|
|
description: |-
|
|
operator represents a key's relationship to a set of values.
|
|
Valid operators are In, NotIn, Exists and DoesNotExist.
|
|
type: string
|
|
values:
|
|
description: |-
|
|
values is an array of string values. If the operator is In or NotIn,
|
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
|
the values array must be empty. This array is replaced during a strategic
|
|
merge patch.
|
|
items:
|
|
type: string
|
|
type: array
|
|
required:
|
|
- key
|
|
- operator
|
|
type: object
|
|
type: array
|
|
matchLabels:
|
|
additionalProperties:
|
|
type: string
|
|
description: |-
|
|
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
|
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
|
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
|
type: object
|
|
type: object
|
|
x-kubernetes-map-type: atomic
|
|
weight:
|
|
description: Weight associated with matching
|
|
the corresponding matchExpressions, in the
|
|
range 1-100.
|
|
format: int32
|
|
type: integer
|
|
required:
|
|
- matchSelector
|
|
- weight
|
|
type: object
|
|
type: array
|
|
type: object
|
|
type: object
|
|
type: object
|
|
type:
|
|
description: |-
|
|
Type indicates the type of the StatefulSetUpdateStrategy.
|
|
Default is RollingUpdate.
|
|
type: string
|
|
type: object
|
|
volumeClaimTemplates:
|
|
description: |-
|
|
volumeClaimTemplates is a list of claims that pods are allowed to reference.
|
|
The StatefulSet controller is responsible for mapping network identities to
|
|
claims in a way that maintains the identity of a pod. Every claim in
|
|
this list must have at least one matching (by name) volumeMount in one
|
|
container in the template. A claim in this list takes precedence over
|
|
any volumes in the template, with the same name.
|
|
TODO: Define the behavior if a claim already exists with the same name.
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
required:
|
|
- selector
|
|
- template
|
|
type: object
|
|
status:
|
|
description: StatefulSetStatus defines the observed state of StatefulSet
|
|
properties:
|
|
availableReplicas:
|
|
description: |-
|
|
AvailableReplicas is the number of Pods created by the StatefulSet controller that have been ready for
|
|
minReadySeconds.
|
|
format: int32
|
|
type: integer
|
|
collisionCount:
|
|
description: |-
|
|
collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
|
|
uses this field as a collision avoidance mechanism when it needs to create the name for the
|
|
newest ControllerRevision.
|
|
format: int32
|
|
type: integer
|
|
conditions:
|
|
description: Represents the latest available observations of a statefulset's
|
|
current state.
|
|
items:
|
|
description: StatefulSetCondition describes the state of a statefulset
|
|
at a certain point.
|
|
properties:
|
|
lastTransitionTime:
|
|
description: Last time the condition transitioned from one status
|
|
to another.
|
|
format: date-time
|
|
type: string
|
|
message:
|
|
description: A human readable message indicating details about
|
|
the transition.
|
|
type: string
|
|
reason:
|
|
description: The reason for the condition's last transition.
|
|
type: string
|
|
status:
|
|
description: Status of the condition, one of True, False, Unknown.
|
|
type: string
|
|
type:
|
|
description: Type of statefulset condition.
|
|
type: string
|
|
required:
|
|
- status
|
|
- type
|
|
type: object
|
|
type: array
|
|
currentReplicas:
|
|
description: |-
|
|
currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
|
indicated by currentRevision.
|
|
format: int32
|
|
type: integer
|
|
currentRevision:
|
|
description: |-
|
|
currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
|
|
sequence [0,currentReplicas).
|
|
type: string
|
|
labelSelector:
|
|
description: LabelSelector is label selectors for query over pods
|
|
that should match the replica count used by HPA.
|
|
type: string
|
|
observedGeneration:
|
|
description: |-
|
|
observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
|
|
StatefulSet's generation, which is updated on mutation by the API Server.
|
|
format: int64
|
|
type: integer
|
|
readyReplicas:
|
|
description: readyReplicas is the number of Pods created by the StatefulSet
|
|
controller that have a Ready Condition.
|
|
format: int32
|
|
type: integer
|
|
replicas:
|
|
description: replicas is the number of Pods created by the StatefulSet
|
|
controller.
|
|
format: int32
|
|
type: integer
|
|
updateRevision:
|
|
description: |-
|
|
updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
|
|
[replicas-updatedReplicas,replicas)
|
|
type: string
|
|
updatedReplicas:
|
|
description: |-
|
|
updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
|
indicated by updateRevision.
|
|
format: int32
|
|
type: integer
|
|
required:
|
|
- availableReplicas
|
|
- currentReplicas
|
|
- readyReplicas
|
|
- replicas
|
|
- updatedReplicas
|
|
type: object
|
|
type: object
|
|
served: true
|
|
storage: false
|
|
subresources:
|
|
scale:
|
|
labelSelectorPath: .status.labelSelector
|
|
specReplicasPath: .spec.replicas
|
|
statusReplicasPath: .status.replicas
|
|
status: {}
|
|
- additionalPrinterColumns:
|
|
- description: The desired number of pods.
|
|
jsonPath: .spec.replicas
|
|
name: DESIRED
|
|
type: integer
|
|
- description: The number of currently all pods.
|
|
jsonPath: .status.replicas
|
|
name: CURRENT
|
|
type: integer
|
|
- description: The number of pods updated.
|
|
jsonPath: .status.updatedReplicas
|
|
name: UPDATED
|
|
type: integer
|
|
- description: The number of pods ready.
|
|
jsonPath: .status.readyReplicas
|
|
name: READY
|
|
type: integer
|
|
- description: CreationTimestamp is a timestamp representing the server time when
|
|
this object was created. It is not guaranteed to be set in happens-before
|
|
order across separate operations. Clients may not set this value. It is represented
|
|
in RFC3339 form and is in UTC.
|
|
jsonPath: .metadata.creationTimestamp
|
|
name: AGE
|
|
type: date
|
|
- description: The containers of currently advanced statefulset.
|
|
jsonPath: .spec.template.spec.containers[*].name
|
|
name: CONTAINERS
|
|
priority: 1
|
|
type: string
|
|
- description: The images of currently advanced statefulset.
|
|
jsonPath: .spec.template.spec.containers[*].image
|
|
name: IMAGES
|
|
priority: 1
|
|
type: string
|
|
name: v1beta1
|
|
schema:
|
|
openAPIV3Schema:
|
|
description: StatefulSet is the Schema for the statefulsets API
|
|
properties:
|
|
apiVersion:
|
|
description: |-
|
|
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
|
|
type: string
|
|
kind:
|
|
description: |-
|
|
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
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
spec:
|
|
description: StatefulSetSpec defines the desired state of StatefulSet
|
|
properties:
|
|
lifecycle:
|
|
description: Lifecycle defines the lifecycle hooks for Pods pre-delete,
|
|
in-place update.
|
|
properties:
|
|
inPlaceUpdate:
|
|
description: InPlaceUpdate is the hook before Pod to update and
|
|
after Pod has been updated.
|
|
properties:
|
|
finalizersHandler:
|
|
items:
|
|
type: string
|
|
type: array
|
|
labelsHandler:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
markPodNotReady:
|
|
description: |-
|
|
MarkPodNotReady = true means:
|
|
- Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state.
|
|
- Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state.
|
|
Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook.
|
|
Default to false.
|
|
type: boolean
|
|
type: object
|
|
preDelete:
|
|
description: PreDelete is the hook before Pod to be deleted.
|
|
properties:
|
|
finalizersHandler:
|
|
items:
|
|
type: string
|
|
type: array
|
|
labelsHandler:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
markPodNotReady:
|
|
description: |-
|
|
MarkPodNotReady = true means:
|
|
- Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state.
|
|
- Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state.
|
|
Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook.
|
|
Default to false.
|
|
type: boolean
|
|
type: object
|
|
preNormal:
|
|
description: PreNormal is the hook after Pod to be created and
|
|
ready to be Normal.
|
|
properties:
|
|
finalizersHandler:
|
|
items:
|
|
type: string
|
|
type: array
|
|
labelsHandler:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
markPodNotReady:
|
|
description: |-
|
|
MarkPodNotReady = true means:
|
|
- Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state.
|
|
- Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state.
|
|
Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook.
|
|
Default to false.
|
|
type: boolean
|
|
type: object
|
|
type: object
|
|
ordinals:
|
|
description: |-
|
|
ordinals controls the numbering of replica indices in a StatefulSet. The
|
|
default ordinals behavior assigns a "0" index to the first replica and
|
|
increments the index by one for each additional replica requested. Using
|
|
the ordinals field requires the StatefulSetStartOrdinal feature gate to be
|
|
enabled, which is beta.
|
|
properties:
|
|
start:
|
|
description: |-
|
|
start is the number representing the first replica's index. It may be used
|
|
to number replicas from an alternate index (eg: 1-indexed) over the default
|
|
0-indexed names, or to orchestrate progressive movement of replicas from
|
|
one StatefulSet to another.
|
|
If set, replica indices will be in the range:
|
|
[.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
|
|
If unset, defaults to 0. Replica indices will be in the range:
|
|
[0, .spec.replicas).
|
|
format: int32
|
|
type: integer
|
|
type: object
|
|
persistentVolumeClaimRetentionPolicy:
|
|
description: |-
|
|
PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from
|
|
the StatefulSet VolumeClaimTemplates. This requires the
|
|
StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.
|
|
properties:
|
|
whenDeleted:
|
|
description: |-
|
|
WhenDeleted specifies what happens to PVCs created from StatefulSet
|
|
VolumeClaimTemplates when the StatefulSet is deleted. The default policy
|
|
of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
|
|
`Delete` policy causes those PVCs to be deleted.
|
|
type: string
|
|
whenScaled:
|
|
description: |-
|
|
WhenScaled specifies what happens to PVCs created from StatefulSet
|
|
VolumeClaimTemplates when the StatefulSet is scaled down. The default
|
|
policy of `Retain` causes PVCs to not be affected by a scaledown. The
|
|
`Delete` policy causes the associated PVCs for any excess pods above
|
|
the replica count to be deleted.
|
|
type: string
|
|
type: object
|
|
podManagementPolicy:
|
|
description: |-
|
|
podManagementPolicy controls how pods are created during initial scale up,
|
|
when replacing pods on nodes, or when scaling down. The default policy is
|
|
`OrderedReady`, where pods are created in increasing order (pod-0, then
|
|
pod-1, etc) and the controller will wait until each pod is ready before
|
|
continuing. When scaling down, the pods are removed in the opposite order.
|
|
The alternative policy is `Parallel` which will create pods in parallel
|
|
to match the desired scale without waiting, and on scale down will delete
|
|
all pods at once.
|
|
type: string
|
|
replicas:
|
|
description: |-
|
|
replicas is the desired number of replicas of the given Template.
|
|
These are replicas in the sense that they are instantiations of the
|
|
same Template, but individual replicas also have a consistent identity.
|
|
If unspecified, defaults to 1.
|
|
TODO: Consider a rename of this field.
|
|
format: int32
|
|
type: integer
|
|
reserveOrdinals:
|
|
description: |-
|
|
reserveOrdinals controls the ordinal numbers that should be reserved, and the replicas
|
|
will always be the expectation number of running Pods.
|
|
For a sts with replicas=3 and its Pods in [0, 1, 2]:
|
|
- If you want to migrate Pod-1 and reserve this ordinal, just set spec.reserveOrdinal to [1].
|
|
Then controller will delete Pod-1 and create Pod-3 (existing Pods will be [0, 2, 3])
|
|
- If you just want to delete Pod-1, you should set spec.reserveOrdinal to [1] and spec.replicas to 2.
|
|
Then controller will delete Pod-1 (existing Pods will be [0, 2])
|
|
items:
|
|
type: integer
|
|
type: array
|
|
revisionHistoryLimit:
|
|
description: |-
|
|
revisionHistoryLimit is the maximum number of revisions that will
|
|
be maintained in the StatefulSet's revision history. The revision history
|
|
consists of all revisions not represented by a currently applied
|
|
StatefulSetSpec version. The default value is 10.
|
|
format: int32
|
|
type: integer
|
|
scaleStrategy:
|
|
description: |-
|
|
scaleStrategy indicates the StatefulSetScaleStrategy that will be
|
|
employed to scale Pods in the StatefulSet.
|
|
properties:
|
|
maxUnavailable:
|
|
anyOf:
|
|
- type: integer
|
|
- type: string
|
|
description: |-
|
|
The maximum number of pods that can be unavailable during scaling.
|
|
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
|
Absolute number is calculated from percentage by rounding down.
|
|
It can just be allowed to work with Parallel podManagementPolicy.
|
|
x-kubernetes-int-or-string: true
|
|
type: object
|
|
selector:
|
|
description: |-
|
|
selector is a label query over pods that should match the replica count.
|
|
It must match the pod template's labels.
|
|
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
|
properties:
|
|
matchExpressions:
|
|
description: matchExpressions is a list of label selector requirements.
|
|
The requirements are ANDed.
|
|
items:
|
|
description: |-
|
|
A label selector requirement is a selector that contains values, a key, and an operator that
|
|
relates the key and values.
|
|
properties:
|
|
key:
|
|
description: key is the label key that the selector applies
|
|
to.
|
|
type: string
|
|
operator:
|
|
description: |-
|
|
operator represents a key's relationship to a set of values.
|
|
Valid operators are In, NotIn, Exists and DoesNotExist.
|
|
type: string
|
|
values:
|
|
description: |-
|
|
values is an array of string values. If the operator is In or NotIn,
|
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
|
the values array must be empty. This array is replaced during a strategic
|
|
merge patch.
|
|
items:
|
|
type: string
|
|
type: array
|
|
required:
|
|
- key
|
|
- operator
|
|
type: object
|
|
type: array
|
|
matchLabels:
|
|
additionalProperties:
|
|
type: string
|
|
description: |-
|
|
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
|
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
|
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
|
type: object
|
|
type: object
|
|
x-kubernetes-map-type: atomic
|
|
serviceName:
|
|
description: |-
|
|
serviceName is the name of the service that governs this StatefulSet.
|
|
This service must exist before the StatefulSet, and is responsible for
|
|
the network identity of the set. Pods get DNS/hostnames that follow the
|
|
pattern: pod-specific-string.serviceName.default.svc.cluster.local
|
|
where "pod-specific-string" is managed by the StatefulSet controller.
|
|
type: string
|
|
template:
|
|
description: |-
|
|
template is the object that describes the pod that will be created if
|
|
insufficient replicas are detected. Each pod stamped out by the StatefulSet
|
|
will fulfill this Template, but have a unique identity from the rest
|
|
of the StatefulSet.
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
updateStrategy:
|
|
description: |-
|
|
updateStrategy indicates the StatefulSetUpdateStrategy that will be
|
|
employed to update Pods in the StatefulSet when a revision is made to
|
|
Template.
|
|
properties:
|
|
rollingUpdate:
|
|
description: RollingUpdate is used to communicate parameters when
|
|
Type is RollingUpdateStatefulSetStrategyType.
|
|
properties:
|
|
inPlaceUpdateStrategy:
|
|
description: InPlaceUpdateStrategy contains strategies for
|
|
in-place update.
|
|
properties:
|
|
gracePeriodSeconds:
|
|
description: |-
|
|
GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec
|
|
when in-place update a Pod.
|
|
format: int32
|
|
type: integer
|
|
type: object
|
|
maxUnavailable:
|
|
anyOf:
|
|
- type: integer
|
|
- type: string
|
|
description: |-
|
|
The maximum number of pods that can be unavailable during the update.
|
|
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
|
Absolute number is calculated from percentage by rounding down.
|
|
Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy.
|
|
Defaults to 1.
|
|
x-kubernetes-int-or-string: true
|
|
minReadySeconds:
|
|
description: |-
|
|
MinReadySeconds indicates how long will the pod be considered ready after it's updated.
|
|
MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy.
|
|
It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady.
|
|
Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy.
|
|
Default value is 0, max is 300.
|
|
format: int32
|
|
type: integer
|
|
partition:
|
|
description: |-
|
|
Partition indicates the ordinal at which the StatefulSet should be partitioned by default.
|
|
But if unorderedUpdate has been set:
|
|
- Partition indicates the number of pods with non-updated revisions when rolling update.
|
|
- It means controller will update $(replicas - partition) number of pod.
|
|
Default value is 0.
|
|
format: int32
|
|
type: integer
|
|
paused:
|
|
description: |-
|
|
Paused indicates that the StatefulSet is paused.
|
|
Default value is false
|
|
type: boolean
|
|
podUpdatePolicy:
|
|
description: |-
|
|
PodUpdatePolicy indicates how pods should be updated
|
|
Default value is "ReCreate"
|
|
type: string
|
|
unorderedUpdate:
|
|
description: |-
|
|
UnorderedUpdate contains strategies for non-ordered update.
|
|
If it is not nil, pods will be updated with non-ordered sequence.
|
|
Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy
|
|
properties:
|
|
priorityStrategy:
|
|
description: |-
|
|
Priorities are the rules for calculating the priority of updating pods.
|
|
Each pod to be updated, will pass through these terms and get a sum of weights.
|
|
properties:
|
|
orderPriority:
|
|
description: |-
|
|
Order priority terms, pods will be sorted by the value of orderedKey.
|
|
For example:
|
|
```
|
|
orderPriority:
|
|
- orderedKey: key1
|
|
- orderedKey: key2
|
|
```
|
|
First, all pods which have key1 in labels will be sorted by the value of key1.
|
|
Then, the left pods which have no key1 but have key2 in labels will be sorted by
|
|
the value of key2 and put behind those pods have key1.
|
|
items:
|
|
description: UpdatePriorityOrderTerm defines order
|
|
priority.
|
|
properties:
|
|
orderedKey:
|
|
description: |-
|
|
Calculate priority by value of this key.
|
|
Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value,
|
|
such as getting 5 in value '5', getting 10 in value 'sts-10'.
|
|
type: string
|
|
required:
|
|
- orderedKey
|
|
type: object
|
|
type: array
|
|
weightPriority:
|
|
description: Weight priority terms, pods will be sorted
|
|
by the sum of all terms weight.
|
|
items:
|
|
description: UpdatePriorityWeightTerm defines weight
|
|
priority.
|
|
properties:
|
|
matchSelector:
|
|
description: MatchSelector is used to select
|
|
by pod's labels.
|
|
properties:
|
|
matchExpressions:
|
|
description: matchExpressions is a list
|
|
of label selector requirements. The requirements
|
|
are ANDed.
|
|
items:
|
|
description: |-
|
|
A label selector requirement is a selector that contains values, a key, and an operator that
|
|
relates the key and values.
|
|
properties:
|
|
key:
|
|
description: key is the label key
|
|
that the selector applies to.
|
|
type: string
|
|
operator:
|
|
description: |-
|
|
operator represents a key's relationship to a set of values.
|
|
Valid operators are In, NotIn, Exists and DoesNotExist.
|
|
type: string
|
|
values:
|
|
description: |-
|
|
values is an array of string values. If the operator is In or NotIn,
|
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
|
the values array must be empty. This array is replaced during a strategic
|
|
merge patch.
|
|
items:
|
|
type: string
|
|
type: array
|
|
required:
|
|
- key
|
|
- operator
|
|
type: object
|
|
type: array
|
|
matchLabels:
|
|
additionalProperties:
|
|
type: string
|
|
description: |-
|
|
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
|
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
|
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
|
type: object
|
|
type: object
|
|
x-kubernetes-map-type: atomic
|
|
weight:
|
|
description: Weight associated with matching
|
|
the corresponding matchExpressions, in the
|
|
range 1-100.
|
|
format: int32
|
|
type: integer
|
|
required:
|
|
- matchSelector
|
|
- weight
|
|
type: object
|
|
type: array
|
|
type: object
|
|
type: object
|
|
type: object
|
|
type:
|
|
description: |-
|
|
Type indicates the type of the StatefulSetUpdateStrategy.
|
|
Default is RollingUpdate.
|
|
type: string
|
|
type: object
|
|
volumeClaimTemplates:
|
|
description: |-
|
|
volumeClaimTemplates is a list of claims that pods are allowed to reference.
|
|
The StatefulSet controller is responsible for mapping network identities to
|
|
claims in a way that maintains the identity of a pod. Every claim in
|
|
this list must have at least one matching (by name) volumeMount in one
|
|
container in the template. A claim in this list takes precedence over
|
|
any volumes in the template, with the same name.
|
|
TODO: Define the behavior if a claim already exists with the same name.
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
required:
|
|
- selector
|
|
- template
|
|
type: object
|
|
status:
|
|
description: StatefulSetStatus defines the observed state of StatefulSet
|
|
properties:
|
|
availableReplicas:
|
|
description: |-
|
|
AvailableReplicas is the number of Pods created by the StatefulSet controller that have been ready for
|
|
minReadySeconds.
|
|
format: int32
|
|
type: integer
|
|
collisionCount:
|
|
description: |-
|
|
collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
|
|
uses this field as a collision avoidance mechanism when it needs to create the name for the
|
|
newest ControllerRevision.
|
|
format: int32
|
|
type: integer
|
|
conditions:
|
|
description: Represents the latest available observations of a statefulset's
|
|
current state.
|
|
items:
|
|
description: StatefulSetCondition describes the state of a statefulset
|
|
at a certain point.
|
|
properties:
|
|
lastTransitionTime:
|
|
description: Last time the condition transitioned from one status
|
|
to another.
|
|
format: date-time
|
|
type: string
|
|
message:
|
|
description: A human readable message indicating details about
|
|
the transition.
|
|
type: string
|
|
reason:
|
|
description: The reason for the condition's last transition.
|
|
type: string
|
|
status:
|
|
description: Status of the condition, one of True, False, Unknown.
|
|
type: string
|
|
type:
|
|
description: Type of statefulset condition.
|
|
type: string
|
|
required:
|
|
- status
|
|
- type
|
|
type: object
|
|
type: array
|
|
currentReplicas:
|
|
description: |-
|
|
currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
|
indicated by currentRevision.
|
|
format: int32
|
|
type: integer
|
|
currentRevision:
|
|
description: |-
|
|
currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
|
|
sequence [0,currentReplicas).
|
|
type: string
|
|
labelSelector:
|
|
description: LabelSelector is label selectors for query over pods
|
|
that should match the replica count used by HPA.
|
|
type: string
|
|
observedGeneration:
|
|
description: |-
|
|
observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
|
|
StatefulSet's generation, which is updated on mutation by the API Server.
|
|
format: int64
|
|
type: integer
|
|
readyReplicas:
|
|
description: readyReplicas is the number of Pods created by the StatefulSet
|
|
controller that have a Ready Condition.
|
|
format: int32
|
|
type: integer
|
|
replicas:
|
|
description: replicas is the number of Pods created by the StatefulSet
|
|
controller.
|
|
format: int32
|
|
type: integer
|
|
updateRevision:
|
|
description: |-
|
|
updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
|
|
[replicas-updatedReplicas,replicas)
|
|
type: string
|
|
updatedAvailableReplicas:
|
|
description: |-
|
|
updatedAvailableReplicas is the number of updated Pods created by the StatefulSet controller that have a Ready condition
|
|
for atleast minReadySeconds.
|
|
format: int32
|
|
type: integer
|
|
updatedReadyReplicas:
|
|
description: updatedReadyReplicas is the number of updated Pods created
|
|
by the StatefulSet controller that have a Ready Condition.
|
|
format: int32
|
|
type: integer
|
|
updatedReplicas:
|
|
description: |-
|
|
updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
|
indicated by updateRevision.
|
|
format: int32
|
|
type: integer
|
|
required:
|
|
- availableReplicas
|
|
- currentReplicas
|
|
- readyReplicas
|
|
- replicas
|
|
- updatedReplicas
|
|
type: object
|
|
type: object
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
scale:
|
|
labelSelectorPath: .status.labelSelector
|
|
specReplicasPath: .spec.replicas
|
|
statusReplicasPath: .status.replicas
|
|
status: {}
|
|
{{- end }}
|