Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/v1alpha1/collaset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ const (
DeletePersistentVolumeClaimRetentionPolicyType PersistentVolumeClaimRetentionPolicyType = "Delete"
)

// HostnamePolicyType indicates how the pod's hostname is determined.
type HostnamePolicyType string

const (
// HostnamePolicyPodName sets the pod's hostname to the pod name.
// This requires namingStrategy.podNamingSuffixPolicy to be PersistentSequence,
// as the pod name must be deterministic before creation.
HostnamePolicyPodName HostnamePolicyType = "PodName"
)
Comment on lines +59 to +67

// PodUpdateStrategyType is a string enumeration type that enumerates
// all possible ways we can update a Pod when updating application
type PodUpdateStrategyType string
Expand Down Expand Up @@ -123,6 +133,12 @@ type CollaSetSpec struct {
// +optional
NamingStrategy *NamingStrategy `json:"namingStrategy,omitempty"`

// HostnamePolicy indicates how the pod's hostname is determined.
// When set to "PodName", the pod's spec.hostname will be set to the pod name.
// This requires NamingStrategy.PodNamingSuffixPolicy to be PersistentSequence.
// +optional
HostnamePolicy HostnamePolicyType `json:"hostnamePolicy,omitempty"`

// Indicate the number of histories to be conserved
// If unspecified, defaults to 20
// +optional
Expand Down
140 changes: 107 additions & 33 deletions config/crd/apps/apps.kusionstack.io_collasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ spec:
If unspecified, defaults to 20
format: int32
type: integer
hostnamePolicy:
description: |-
HostnamePolicy indicates how the pod's hostname is determined.
When set to "PodName", the pod's spec.hostname will be set to the pod name.
This requires NamingStrategy.PodNamingSuffixPolicy to be PersistentSequence.
type: string
namingStrategy:
description: NamigPolicy indicates the strategy detail that will be
used for replica naming
Expand Down Expand Up @@ -304,25 +310,26 @@ spec:
type: object
spec:
description: |-
Spec defines the desired characteristics of a volume requested by a pod author.
spec defines the desired characteristics of a volume requested by a pod author.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
properties:
accessModes:
description: |-
AccessModes contains the desired access modes the volume should have.
accessModes contains the desired access modes the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
items:
type: string
type: array
dataSource:
description: |-
This field can be used to specify either:
dataSource field can be used to specify either:
* An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
* An existing PVC (PersistentVolumeClaim)
If the provisioner or an external controller can support the specified data source,
it will create a new volume based on the contents of the specified data source.
If the AnyVolumeDataSource feature gate is enabled, this field will always have
the same contents as the DataSourceRef field.
When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
If the namespace is specified, then dataSourceRef will not be copied to dataSource.
properties:
apiGroup:
description: |-
Expand All @@ -343,23 +350,29 @@ spec:
x-kubernetes-map-type: atomic
dataSourceRef:
description: |-
Specifies the object from which to populate the volume with data, if a non-empty
volume is desired. This may be any local object from a non-empty API group (non
dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
volume is desired. This may be any object from a non-empty API group (non
core object) or a PersistentVolumeClaim object.
When this field is specified, volume binding will only succeed if the type of
the specified object matches some installed volume populator or dynamic
provisioner.
This field will replace the functionality of the DataSource field and as such
This field will replace the functionality of the dataSource field and as such
if both fields are non-empty, they must have the same value. For backwards
compatibility, both fields (DataSource and DataSourceRef) will be set to the same
compatibility, when namespace isn't specified in dataSourceRef,
both fields (dataSource and dataSourceRef) will be set to the same
value automatically if one of them is empty and the other is non-empty.
There are two important differences between DataSource and DataSourceRef:
* While DataSource only allows two specific types of objects, DataSourceRef
When namespace is specified in dataSourceRef,
dataSource isn't set to the same value and must be empty.
There are three important differences between dataSource and dataSourceRef:
* While dataSource only allows two specific types of objects, dataSourceRef
allows any non-core object, as well as PersistentVolumeClaim objects.
* While DataSource ignores disallowed values (dropping them), DataSourceRef
* While dataSource ignores disallowed values (dropping them), dataSourceRef
preserves all values, and generates an error if a disallowed value is
specified.
(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
* While dataSource only allows local objects, dataSourceRef allows objects
in any namespaces.
(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
(Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
properties:
apiGroup:
description: |-
Expand All @@ -373,16 +386,52 @@ spec:
name:
description: Name is the name of resource being referenced
type: string
namespace:
description: |-
Namespace is the namespace of resource being referenced
Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
(Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
resources:
description: |-
Resources represents the minimum resources the volume should have.
resources represents the minimum resources the volume should have.
If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
that are lower than previous value but must still be higher than capacity recorded in the
status field of the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
properties:
claims:
description: |-
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.


This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.


This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in
PodSpec.ResourceClaims.
properties:
name:
description: |-
Name must match the name of one entry in pod.spec.resourceClaims of
the Pod where this field is used. It makes that resource available
inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand All @@ -404,13 +453,13 @@ spec:
description: |-
Requests describes the minimum amount of compute resources required.
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
otherwise to an implementation-defined value.
otherwise to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
type: object
selector:
description: A label query over volumes to consider for
binding.
description: selector is a label query over volumes to consider
for binding.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
Expand Down Expand Up @@ -455,7 +504,7 @@ spec:
x-kubernetes-map-type: atomic
storageClassName:
description: |-
Name of the StorageClass required by the claim.
storageClassName is the name of the StorageClass required by the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
type: string
volumeMode:
Expand All @@ -464,57 +513,75 @@ spec:
Value of Filesystem is implied when not included in claim spec.
type: string
volumeName:
description: VolumeName is the binding reference to the
description: volumeName is the binding reference to the
PersistentVolume backing this claim.
type: string
type: object
status:
description: |-
Status represents the current information/status of a persistent volume claim.
status represents the current information/status of a persistent volume claim.
Read-only.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
properties:
accessModes:
description: |-
AccessModes contains the actual access modes the volume backing the PVC has.
accessModes contains the actual access modes the volume backing the PVC has.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
items:
type: string
type: array
allocatedResources:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: |-
allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may
be larger than the actual capacity when a volume expansion operation is requested.
For storage quota, the larger value from allocatedResources and PVC.spec.resources is used.
If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation.
If a volume expansion capacity request is lowered, allocatedResources is only
lowered if there are no expansion operations in progress and if the actual volume capacity
is equal or lower than the requested capacity.
This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
type: object
capacity:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Represents the actual resources of the underlying
volume.
description: capacity represents the actual resources of
the underlying volume.
type: object
conditions:
description: |-
Current Condition of persistent volume claim. If underlying persistent volume is being
conditions is the current Condition of persistent volume claim. If underlying persistent volume is being
resized then the Condition will be set to 'ResizeStarted'.
items:
description: PersistentVolumeClaimCondition contails details
description: PersistentVolumeClaimCondition contains details
about state of pvc
properties:
lastProbeTime:
description: Last time we probed the condition.
description: lastProbeTime is the time we probed the
condition.
format: date-time
type: string
lastTransitionTime:
description: Last time the condition transitioned
from one status to another.
description: lastTransitionTime is the time the condition
transitioned from one status to another.
format: date-time
type: string
message:
description: Human-readable message indicating details
about last transition.
description: message is the human-readable message
indicating details about last transition.
type: string
reason:
description: |-
Unique, this should be a short, machine understandable string that gives the reason
reason is a unique, this should be a short, machine understandable string that gives the reason
for condition's last transition. If it reports "ResizeStarted" that means the underlying
persistent volume is being resized.
type: string
Expand All @@ -530,7 +597,14 @@ spec:
type: object
type: array
phase:
description: Phase represents the current phase of PersistentVolumeClaim.
description: phase represents the current phase of PersistentVolumeClaim.
type: string
resizeStatus:
description: |-
resizeStatus stores status of resize operation.
ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty
string by resize controller or kubelet.
This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
type: string
type: object
type: object
Expand Down
Loading
Loading