From 08365c26338d0ffe79e904738d0485a943ab2e60 Mon Sep 17 00:00:00 2001 From: Jesper Larsson Date: Fri, 12 Jul 2024 15:31:24 +0200 Subject: [PATCH] Document properties of lookup crd --- apis/druid/v1alpha1/druidlookup_types.go | 28 ++ chart/crds/druid.apache.org_druidlookups.yaml | 48 ++- .../bases/druid.apache.org_druidlookups.yaml | 48 ++- docs/api_specifications/druid.md | 321 ++++++++++++++++++ 4 files changed, 437 insertions(+), 8 deletions(-) diff --git a/apis/druid/v1alpha1/druidlookup_types.go b/apis/druid/v1alpha1/druidlookup_types.go index 42c13b7d..088a061f 100644 --- a/apis/druid/v1alpha1/druidlookup_types.go +++ b/apis/druid/v1alpha1/druidlookup_types.go @@ -31,46 +31,74 @@ import ( type DruidLookupSpec struct { // Important: Run "make" to regenerate code after modifying this file + // The name of the druid cluster to apply the lookup in. + // + // Assumed to be within the same k8s namespace. // +required DruidCluster v1.LocalObjectReference `json:"druidCluster"` + // The tier to put the lookup in. // +optional // +kubebuilder:default:=__default Tier string `json:"tier"` + // Lookup template. + // + // Any stringified json value that is applicable in the `lookupExtractorFactory` field. + // + // Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup. // +required Template string `json:"template"` } // DruidLookupStatus defines the observed state of DruidLookup type DruidLookupStatus struct { + + // `true` if the druid cluster has reported that the lookup is loaded on all relevant nodes, otherwise false. // +optional Loaded *bool `json:"loaded,omitempty"` + // A list of the nodes that the druid cluster reports to yet have loaded the lookup. // +optional PendingNodes []string `json:"pendingNodes,omitempty"` + // The number of nodes that the druid cluster reports to yet have loaded the lookup. + // + // (Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.) // +optional NumberOfPendingNodes *int `json:"numberOfPendingNodes,omitempty"` + // The druid cluster that the last successful application of this lookup happened in. + // + // Used to determine if changes require old lookup to be deleted. // +optional LastClusterAppliedIn v1.LocalObjectReference `json:"lastClusterAppliedIn"` + // The tier that the last successful application of this lookup happened in. + // + // Used to determine if changes require old lookup to be deleted. // +optional LastTierAppliedIn string `json:"lastTierAppliedIn"` + // The template that the last successful application of this lookup applied. + // + // Used to determine if changes require old lookup to be deleted. // +optional LastAppliedTemplate string `json:"lastAppliedTemplate,omitempty"` + // The time that the last successful application of this lookup happened at. // +optional LastSuccessfulUpdateAt *metav1.Time `json:"lastSuccessfulUpdateAt,omitempty"` + // The time that the last attempt to apply this lookup happened at. // +optional LastUpdateAttemptAt *metav1.Time `json:"lastUpdateAttemptAt,omitempty"` + // `true` if the last application attempt were successful, `false` otherwise. // +optional LastUpdateAttemptSuccessful bool `json:"lastUpdateAttemptSuccessful,omitempty"` + // If the last application attempt failed, this property contains the associated error message, otherwise unset. // +optional ErrorMessage string `json:"errorMessage,omitempty"` } diff --git a/chart/crds/druid.apache.org_druidlookups.yaml b/chart/crds/druid.apache.org_druidlookups.yaml index 57399d1a..85d34f87 100644 --- a/chart/crds/druid.apache.org_druidlookups.yaml +++ b/chart/crds/druid.apache.org_druidlookups.yaml @@ -66,8 +66,10 @@ spec: properties: druidCluster: description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + The name of the druid cluster to apply the lookup in. + + + Assumed to be within the same k8s namespace. properties: name: description: |- @@ -78,9 +80,18 @@ spec: type: object x-kubernetes-map-type: atomic template: + description: |- + Lookup template. + + + Any stringified json value that is applicable in the `lookupExtractorFactory` field. + + + Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup. type: string tier: default: __default + description: The tier to put the lookup in. type: string required: - druidCluster @@ -90,13 +101,22 @@ spec: description: DruidLookupStatus defines the observed state of DruidLookup properties: errorMessage: + description: If the last application attempt failed, this property + contains the associated error message, otherwise unset. type: string lastAppliedTemplate: + description: |- + The template that the last successful application of this lookup applied. + + + Used to determine if changes require old lookup to be deleted. type: string lastClusterAppliedIn: description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + The druid cluster that the last successful application of this lookup happened in. + + + Used to determine if changes require old lookup to be deleted. properties: name: description: |- @@ -107,20 +127,40 @@ spec: type: object x-kubernetes-map-type: atomic lastSuccessfulUpdateAt: + description: The time that the last successful application of this + lookup happened at. format: date-time type: string lastTierAppliedIn: + description: |- + The tier that the last successful application of this lookup happened in. + + + Used to determine if changes require old lookup to be deleted. type: string lastUpdateAttemptAt: + description: The time that the last attempt to apply this lookup happened + at. format: date-time type: string lastUpdateAttemptSuccessful: + description: '`true` if the last application attempt were successful, + `false` otherwise.' type: boolean loaded: + description: '`true` if the druid cluster has reported that the lookup + is loaded on all relevant nodes, otherwise false.' type: boolean numberOfPendingNodes: + description: |- + The number of nodes that the druid cluster reports to yet have loaded the lookup. + + + (Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.) type: integer pendingNodes: + description: A list of the nodes that the druid cluster reports to + yet have loaded the lookup. items: type: string type: array diff --git a/config/crd/bases/druid.apache.org_druidlookups.yaml b/config/crd/bases/druid.apache.org_druidlookups.yaml index 57399d1a..85d34f87 100644 --- a/config/crd/bases/druid.apache.org_druidlookups.yaml +++ b/config/crd/bases/druid.apache.org_druidlookups.yaml @@ -66,8 +66,10 @@ spec: properties: druidCluster: description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + The name of the druid cluster to apply the lookup in. + + + Assumed to be within the same k8s namespace. properties: name: description: |- @@ -78,9 +80,18 @@ spec: type: object x-kubernetes-map-type: atomic template: + description: |- + Lookup template. + + + Any stringified json value that is applicable in the `lookupExtractorFactory` field. + + + Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup. type: string tier: default: __default + description: The tier to put the lookup in. type: string required: - druidCluster @@ -90,13 +101,22 @@ spec: description: DruidLookupStatus defines the observed state of DruidLookup properties: errorMessage: + description: If the last application attempt failed, this property + contains the associated error message, otherwise unset. type: string lastAppliedTemplate: + description: |- + The template that the last successful application of this lookup applied. + + + Used to determine if changes require old lookup to be deleted. type: string lastClusterAppliedIn: description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + The druid cluster that the last successful application of this lookup happened in. + + + Used to determine if changes require old lookup to be deleted. properties: name: description: |- @@ -107,20 +127,40 @@ spec: type: object x-kubernetes-map-type: atomic lastSuccessfulUpdateAt: + description: The time that the last successful application of this + lookup happened at. format: date-time type: string lastTierAppliedIn: + description: |- + The tier that the last successful application of this lookup happened in. + + + Used to determine if changes require old lookup to be deleted. type: string lastUpdateAttemptAt: + description: The time that the last attempt to apply this lookup happened + at. format: date-time type: string lastUpdateAttemptSuccessful: + description: '`true` if the last application attempt were successful, + `false` otherwise.' type: boolean loaded: + description: '`true` if the druid cluster has reported that the lookup + is loaded on all relevant nodes, otherwise false.' type: boolean numberOfPendingNodes: + description: |- + The number of nodes that the druid cluster reports to yet have loaded the lookup. + + + (Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.) type: integer pendingNodes: + description: A list of the nodes that the druid cluster reports to + yet have loaded the lookup. items: type: string type: array diff --git a/docs/api_specifications/druid.md b/docs/api_specifications/druid.md index fd57ded3..b165aa70 100644 --- a/docs/api_specifications/druid.md +++ b/docs/api_specifications/druid.md @@ -1322,6 +1322,315 @@ string +

DruidLookup +

+

DruidLookup is the Schema for the druidlookups API

+
+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +DruidLookupSpec + + +
+
+
+ + + + + + + + + + + + + +
+druidCluster
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

The name of the druid cluster to apply the lookup in.

+

Assumed to be within the same k8s namespace.

+
+tier
+ +string + +
+(Optional) +

The tier to put the lookup in.

+
+template
+ +string + +
+

Lookup template.

+

Any stringified json value that is applicable in the lookupExtractorFactory field.

+

Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup.

+
+
+status
+ + +DruidLookupStatus + + +
+
+
+
+

DruidLookupSpec +

+

+(Appears on: +DruidLookup) +

+

DruidLookupSpec defines the desired state of DruidLookup

+
+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+druidCluster
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

The name of the druid cluster to apply the lookup in.

+

Assumed to be within the same k8s namespace.

+
+tier
+ +string + +
+(Optional) +

The tier to put the lookup in.

+
+template
+ +string + +
+

Lookup template.

+

Any stringified json value that is applicable in the lookupExtractorFactory field.

+

Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup.

+
+
+
+

DruidLookupStatus +

+

+(Appears on: +DruidLookup) +

+

DruidLookupStatus defines the observed state of DruidLookup

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+loaded
+ +bool + +
+(Optional) +

true if the druid cluster has reported that the lookup is loaded on all relevant nodes, otherwise false.

+
+pendingNodes
+ +[]string + +
+(Optional) +

A list of the nodes that the druid cluster reports to yet have loaded the lookup.

+
+numberOfPendingNodes
+ +int + +
+(Optional) +

The number of nodes that the druid cluster reports to yet have loaded the lookup.

+

(Exists in conjunction with PendingNodes to facilitate displaying this summary using kubebuilders print column feature.)

+
+lastClusterAppliedIn
+ + +Kubernetes core/v1.LocalObjectReference + + +
+(Optional) +

The druid cluster that the last successful application of this lookup happened in.

+

Used to determine if changes require old lookup to be deleted.

+
+lastTierAppliedIn
+ +string + +
+(Optional) +

The tier that the last successful application of this lookup happened in.

+

Used to determine if changes require old lookup to be deleted.

+
+lastAppliedTemplate
+ +string + +
+(Optional) +

The template that the last successful application of this lookup applied.

+

Used to determine if changes require old lookup to be deleted.

+
+lastSuccessfulUpdateAt
+ + +Kubernetes meta/v1.Time + + +
+(Optional) +

The time that the last successful application of this lookup happened at.

+
+lastUpdateAttemptAt
+ + +Kubernetes meta/v1.Time + + +
+(Optional) +

The time that the last attempt to apply this lookup happened at.

+
+lastUpdateAttemptSuccessful
+ +bool + +
+(Optional) +

true if the last application attempt were successful, false otherwise.

+
+errorMessage
+ +string + +
+(Optional) +

If the last application attempt failed, this property contains the associated error message, otherwise unset.

+
+
+

DruidNodeConditionType (string alias)

@@ -1942,6 +2251,18 @@ Kubernetes autoscaling/v2.HorizontalPodAutoscalerSpec

Operator deploys the sidecar container based on these properties.

+ + +serviceAccountName
+ +string + + + +(Optional) +

ServiceAccountName Kubernetes native serviceAccountName specification.

+ +