Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RecreateNodeAnnotationKey const #16

Merged
merged 12 commits into from
Sep 16, 2024
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"
Robert-Stam marked this conversation as resolved.
Show resolved Hide resolved
)

// 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.
Robert-Stam marked this conversation as resolved.
Show resolved Hide resolved
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.
Robert-Stam marked this conversation as resolved.
Show resolved Hide resolved
// +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