Skip to content

Commit

Permalink
Added QC.Spec.StartupDelaySeconds (#65)
Browse files Browse the repository at this point in the history
* Added QC.Spec.EmitSleep

And removed QC.Spec.Distributed (which was deprecated for a long time and Operator V1 isn't used anymore.

* Renamed EmitSleep to StartupDelaySeconds

* Fiuced typo
  • Loading branch information
Robert-Stam authored Jan 14, 2025
1 parent 376626c commit 2c5b25d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
11 changes: 7 additions & 4 deletions api/v1/qdrantcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func GetQdrantClusterCrdForHash(qc QdrantCluster) QdrantCluster {
// Remove all fields (aka set a fixed value) which shouldn't restart the pod
// The list is sorted alphabetically, for easier maintainability
cloned.ClusterManager = nil
cloned.Distributed = false
cloned.Ingress = nil
cloned.Pauses = nil
cloned.Resources.Storage = ""
Expand All @@ -64,6 +63,7 @@ func GetQdrantClusterCrdForHash(qc QdrantCluster) QdrantCluster {
if v := cloned.StatefulSet; v != nil {
v.Annotations = nil
}
cloned.StartupDelaySeconds = nil
cloned.StorageClassNames = nil
cloned.Suspend = false
// Set Spec for result
Expand Down Expand Up @@ -102,9 +102,6 @@ type QdrantClusterSpec struct {
// Operator will skip handling any changes in the CR if any pause request is present.
// +optional
Pauses []Pause `json:"pauses,omitempty"`
// Deprecated
// +optional
Distributed bool `json:"distributed,omitempty"`
// Image specifies the image to use for each Qdrant node.
// +optional
Image *QdrantImage `json:"image,omitempty"`
Expand Down Expand Up @@ -146,6 +143,12 @@ type QdrantClusterSpec struct {
// This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart.
// +optional
RestartAllPodsConcurrently bool `json:"restartAllPodsConcurrently,omitempty"`
// If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.
// The sleep will be added when a pod is restarted, it will not force any pod to restart.
// This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way
// to inspect the attached storage.
// +optional
StartupDelaySeconds *int `json:"startupDelaySeconds,omitempty"`
}

// Validates if there are incorrect settings in the CRD
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ spec:
type: object
type: object
type: object
distributed:
description: Deprecated
type: boolean
id:
description: Id specifies the unique identifier of the cluster
type: string
Expand Down Expand Up @@ -545,6 +542,13 @@ spec:
maximum: 30
minimum: 1
type: integer
startupDelaySeconds:
description: |-
If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.
The sleep will be added when a pod is restarted, it will not force any pod to restart.
This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way
to inspect the attached storage.
type: integer
statefulSet:
description: StatefulSet specifies the configuration of the Qdrant
Kubernetes StatefulSet.
Expand Down
10 changes: 7 additions & 3 deletions crds/qdrant.io_qdrantclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ spec:
type: object
type: object
type: object
distributed:
description: Deprecated
type: boolean
id:
description: Id specifies the unique identifier of the cluster
type: string
Expand Down Expand Up @@ -544,6 +541,13 @@ spec:
maximum: 30
minimum: 1
type: integer
startupDelaySeconds:
description: |-
If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.
The sleep will be added when a pod is restarted, it will not force any pod to restart.
This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way
to inspect the attached storage.
type: integer
statefulSet:
description: StatefulSet specifies the configuration of the Qdrant
Kubernetes StatefulSet.
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ _Appears in:_
| `clusterManager` _boolean_ | ClusterManager specifies whether to use the cluster manager for this cluster.<br />The Python-operator will deploy a dedicated cluster manager instance.<br />The Go-operator will use a shared instance.<br />If not set, the default will be taken from the operator config. | | |
| `suspend` _boolean_ | Suspend specifies whether to suspend the cluster.<br />If enabled, the cluster will be suspended and all related resources will be removed except the PVCs. | false | |
| `pauses` _[Pause](#pause) array_ | Pauses specifies a list of pause request by developer for manual maintenance.<br />Operator will skip handling any changes in the CR if any pause request is present. | | |
| `distributed` _boolean_ | Deprecated | | |
| `image` _[QdrantImage](#qdrantimage)_ | Image specifies the image to use for each Qdrant node. | | |
| `resources` _[Resources](#resources)_ | Resources specifies the resources to allocate for each Qdrant node. | | |
| `security` _[QdrantSecurityContext](#qdrantsecuritycontext)_ | Security specifies the security context for each Qdrant node. | | |
Expand All @@ -659,6 +658,7 @@ _Appears in:_
| `topologySpreadConstraints` _[TopologySpreadConstraint](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#topologyspreadconstraint-v1-core)_ | TopologySpreadConstraints specifies the topology spread constraints for the cluster. | | |
| `podDisruptionBudget` _[PodDisruptionBudgetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#poddisruptionbudgetspec-v1-policy)_ | PodDisruptionBudget specifies the pod disruption budget for the cluster. | | |
| `restartAllPodsConcurrently` _boolean_ | RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).<br />If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods<br />need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.<br />This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart. | | |
| `startupDelaySeconds` _integer_ | If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.<br />The sleep will be added when a pod is restarted, it will not force any pod to restart.<br />This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way<br />to inspect the attached storage. | | |



Expand Down

0 comments on commit 2c5b25d

Please sign in to comment.