Skip to content

Commit 2979f97

Browse files
authored
Introduce additional error status fields for QdrantCluster and QdrantClusterSnapshot (#161)
* Introduce additional error status fields for QdrantCluster and QdrantClusterSnapshot * Fix lint * make gen * Add last cluster manager response time * Fix typo * Docs, subresource * Update docs * Add more fields for iops changes
1 parent 8db1e4f commit 2979f97

File tree

11 files changed

+1966
-5
lines changed

11 files changed

+1966
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ gen: manifests generate format vet ## Generate code containing DeepCopy, DeepCop
3030

3131
.PHONY: manifests
3232
manifests: controller-gen ## Generate CustomResourceDefinition objects.
33-
rm $(CHART_DIR)/templates/management-crds/*.yaml
34-
rm $(CHART_DIR)/templates/region-crds/*.yaml
35-
rm $(CHART_DIR)/templates/auth-crds/*.yaml
33+
rm $(CHART_DIR)/templates/management-crds/*.yaml || true
34+
rm $(CHART_DIR)/templates/region-crds/*.yaml || true
35+
rm $(CHART_DIR)/templates/auth-crds/*.yaml || true
3636
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=$(CRDS_DIR)
3737
mv $(CRDS_DIR)/qdrant.io_qdrantreleases.yaml $(CHART_DIR)/templates/management-crds/
3838
cp $(CRDS_DIR)/qdrant*.yaml $(CHART_DIR)/templates/region-crds/

api/v1/qdrantcluster_types.go

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package v1
22

33
import (
4+
"encoding/json"
45
"fmt"
56

67
corev1 "k8s.io/api/core/v1"
@@ -898,6 +899,42 @@ type QdrantClusterStatus struct {
898899
// This version can differ from the spec, because version updates need to be done in order (see `update-path` annotation)
899900
// +optional
900901
Version string `json:"version,omitempty"`
902+
// The last response from the cluster-manager manage endpoint
903+
// +optional
904+
ClusterManagerReponse *ClusterManagerReponse `json:"clusterManagerResponse,omitempty"`
905+
}
906+
907+
type ClusterManagerReponse struct {
908+
// The last time the cluster-manager responded in UTC
909+
// +optional
910+
LastResponseTime *metav1.Time `json:"lastResponseTime,omitempty"`
911+
// ExecutedActions are the actions that have been executed by the cluster-manager
912+
// +optional
913+
ExecutedActions *[]json.RawMessage `json:"executed_actions,omitempty"`
914+
// RequiredActions are the actions that are required to be executed by the operator as instructed by cluster-manager
915+
// +optional
916+
RequiredActions *[]json.RawMessage `json:"required_actions,omitempty"`
917+
// SuggestedActions are suggested but not required actions to be executed by the operator as instructed by cluster-manager
918+
// +optional
919+
SuggestedActions *[]json.RawMessage `json:"suggested_actions,omitempty"`
920+
}
921+
922+
type KubernetesEventInfo struct {
923+
// Event message
924+
// +optional
925+
Message string `json:"message,omitempty"`
926+
// Event reason
927+
// +optional
928+
Reason string `json:"reason,omitempty"`
929+
// How many times the event has occurred
930+
// +optional
931+
Count int32 `json:"count,omitempty"`
932+
// The first time the event was seen
933+
// +optional
934+
FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty"`
935+
// The last time the event was seen
936+
// +optional
937+
LastTimestamp metav1.Time `json:"lastTimestamp,omitempty"`
901938
}
902939

903940
type NodeStatus struct {
@@ -917,6 +954,64 @@ type NodeStatus struct {
917954
// This is needed to beter report recovery process to the user.
918955
// +optional
919956
Liveness bool `json:"liveness,omitempty"`
957+
958+
// Status phase of the Pod of the node
959+
// +optional
960+
PodPhase corev1.PodPhase `json:"podPhase,omitempty"`
961+
// Conditions of the Pod of the node
962+
// +optional
963+
PodConditions []corev1.PodCondition `json:"podConditions,omitempty"`
964+
// Status message of the Pod of the node
965+
// +optional
966+
PodMessage string `json:"podMessage,omitempty"`
967+
// Status reason of the Pod of the node
968+
// +optional
969+
PodReason string `json:"podReason,omitempty"`
970+
// Details container statuses of the Pod of the node
971+
// +optional
972+
ContainerStatuses []corev1.ContainerStatus `json:"containerStatuses,omitempty"`
973+
// Recent Kubernetes Events related to the Pod of the node
974+
// Events that happened in the last 30 minutes are stored.
975+
// +optional
976+
PodEvents []KubernetesEventInfo `json:"events,omitempty"`
977+
978+
// The number of times the main qdrant container has been restarted.
979+
// +optional
980+
RestartCount int32 `json:"restartCount,omitempty"`
981+
982+
// Status of the database storage PVC
983+
// +optional
984+
DatabasePVCStatus NodePVCStatus `json:"databasePVCStatus,omitempty"`
985+
// Status of the snapshots storage PVC
986+
// +optional
987+
SnapshotsPVCStatus NodePVCStatus `json:"snapshotsPVCStatus,omitempty"`
988+
}
989+
990+
type NodePVCStatus struct {
991+
// Name of the StorageClass used by the PVC
992+
// +optional
993+
StorageClassName string `json:"storageClassName,omitempty"`
994+
// Status phase of the PVC
995+
// +optional
996+
Phase corev1.PersistentVolumeClaimPhase `json:"phase,omitempty"`
997+
// Conditions of the PVC
998+
// +optional
999+
Conditions []corev1.PersistentVolumeClaimCondition `json:"conditions,omitempty"`
1000+
// Recent Kubernetes Events related to the PVC
1001+
// Events that happened in the last 30 minutes are stored.
1002+
// +optional
1003+
Events []KubernetesEventInfo `json:"events,omitempty"`
1004+
// capacity represents the actual resources of the underlying volume.
1005+
// +optional
1006+
Capacity corev1.ResourceList `json:"capacity,omitempty"`
1007+
// currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using.
1008+
// When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim
1009+
// +optional
1010+
CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"`
1011+
// ModifyVolumeStatus represents the status object of ControllerModifyVolume operation.
1012+
// When this is unset, there is no ModifyVolume operation being attempted.
1013+
// +optional
1014+
ModifyVolumeStatus *corev1.ModifyVolumeStatus `json:"modifyVolumeStatus,omitempty"`
9201015
}
9211016

9221017
//+kubebuilder:object:root=true

api/v1/qdrantclustersnapshot_types.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package v1
22

3-
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3+
import (
4+
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
5+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
6+
)
47

58
//goland:noinspection GoUnusedConst
69
const (
@@ -66,6 +69,13 @@ type VolumeSnapshotInfo struct {
6669
// SnapshotHandle is the identifier of the volume snapshot in the respective cloud provider
6770
// +optional
6871
SnapshotHandle string `json:"snapshotHandle,omitempty"`
72+
// Error contains the error details if the snapshot creation failed
73+
// +optional
74+
Error *volumesnapshotv1.VolumeSnapshotError `json:"error,omitempty"`
75+
// Recent Kubernetes Events related to the VolumeSnapshot
76+
// Events that happened in the last 30 minutes are stored.
77+
// +optional
78+
Events []KubernetesEventInfo `json:"events,omitempty"`
6979
}
7080

7181
// +kubebuilder:object:root=true

api/v1/zz_generated.deepcopy.go

Lines changed: 172 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)