Skip to content

Commit

Permalink
Added RecreateNodeAnnotationKey const (#16)
Browse files Browse the repository at this point in the history
* Added RecreateNodeAnnotationKey const

And improved documentation for RestartedAtAnnotationKey

* Improved documentation

* Added one more case

* improved comments.

* removed space

* not --> none

* switched order

* more line shuffling

* added requirement of CM

* Addressed comments (annot will be placed on pod)

* Value from annot is free to use. Added Status.ScaleDownNodeIndex field

And improved some comments

* added non-empty
  • Loading branch information
Robert-Stam authored Sep 16, 2024
1 parent 0daca45 commit 3752f72
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
19 changes: 17 additions & 2 deletions api/v1/qdrantcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ const (
)

const (
// The Annotation key to trigger a restart.
// RestartedAtAnnotationKey is the annotation key to trigger a restart.
// The annotation should be placed on the QdrantCluster instance.
// The value should be a [RFC3339 formatted] date.
// If the value is updated it will retrigger the restart.
// For historical reasons the key doesn't start with `operator.qdrant.com/`
RestartedAtAnnotationKey = "restartedAt"
// RecreateNodeAnnotationKey is the annotation key to recreate a certain node.
// The annotation should be placed on the pod created by the operator (for the node that need to be recreated).
// It is allowed to add this annotation to multiple pods, the operator will handle them all.
// The value should be non-empty, but is free to use, and will be used in Events.
// This feature requires that the cluster-manager is enabled.
RecreateNodeAnnotationKey = "operator.qdrant.com/recreate-node"
)

// GetQdrantClusterCrdForHash creates a QdrantCluster for the use of creating a hash for the provided QdrantCluster,
Expand Down Expand Up @@ -693,17 +703,22 @@ type QdrantClusterStatus struct {
// +optional
AvailableNodeIndexes []int `json:"availableNodeIndexes,omitempty"`
// BootstrapNode specifies the node in the cluster which will be used for bootstrapping a new node.
// Should be 0...n-1 (default = 0)
// Should be a value from AvailableNodeIndexes.
// As default the value from AvailableNodeIndexes[0] will be used.
// +optional
BootstrapNode int `json:"bootstrapNode,omitempty"`
// If set the operator will scale down 1 peer and reset the bool.
// If you want to remove more then 1 peer, you need to repeat setting this bool
// +optional
ScaleDownAllowed bool `json:"scaleDownAllowed,omitempty"`
// The node index used in a scale down (see ScaleDownAllowed)
// If this field is not set the last index in AvailableNodeIndexes will be used.
ScaleDownNodeIndex *int `json:"ScaleDownNodeIndex,omitempty"`
// Conditions specifies the conditions of different checks on the cluster
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Operations tracks list of recent operation on the cluster. Operator uses this field to track the progress of an operation.
// In operator V2 this field is deprecated and Kubernetes events are used instead.
// +optional
Operations []Operation `json:"operations,omitempty"`
// Nodes specifies the status of the nodes in the cluster
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.

13 changes: 10 additions & 3 deletions charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,11 @@ spec:
status:
description: QdrantClusterStatus defines the observed state of QdrantCluster
properties:
ScaleDownNodeIndex:
description: |-
The node index used in a scale down (see ScaleDownAllowed)
If this field is not set the last index in AvailableNodeIndexes will be used.
type: integer
availableNodeIndexes:
description: |-
AvailableNodeIndexes specifies the indexes of the individual nodes in the cluster
Expand All @@ -928,7 +933,8 @@ spec:
bootstrapNode:
description: |-
BootstrapNode specifies the node in the cluster which will be used for bootstrapping a new node.
Should be 0...n-1 (default = 0)
Should be a value from AvailableNodeIndexes.
As default the value from AvailableNodeIndexes[0] will be used.
type: integer
conditions:
description: Conditions specifies the conditions of different checks
Expand Down Expand Up @@ -1015,8 +1021,9 @@ spec:
description: Nodes specifies the status of the nodes in the cluster
type: object
operations:
description: Operations tracks list of recent operation on the cluster.
Operator uses this field to track the progress of an operation.
description: |-
Operations tracks list of recent operation on the cluster. Operator uses this field to track the progress of an operation.
In operator V2 this field is deprecated and Kubernetes events are used instead.
items:
properties:
completionTime:
Expand Down

0 comments on commit 3752f72

Please sign in to comment.