@@ -25,136 +25,136 @@ import (
2525// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2626
2727type DiskCacheSpec struct {
28- // Whether to enable cache in disk.
29- // +kubebuilder:default=false
30- Enabled bool `json:"enabled,omitempty"`
28+ // Whether to enable cache in disk.
29+ // +kubebuilder:default=false
30+ Enabled bool `json:"enabled,omitempty"`
3131
32- // Max bytes of cache in disk.
33- MaxBytes int `json:"size,omitempty"`
32+ // Max bytes of cache in disk.
33+ MaxBytes int `json:"size,omitempty"`
3434
35- // Path to cache directory in disk.
36- // If not set, default to /var/lib/databend/cache.
37- Path string `json:"path,omitempty"`
35+ // Path to cache directory in disk.
36+ // If not set, default to /var/lib/databend/cache.
37+ Path string `json:"path,omitempty"`
3838
39- // Provide storage class to allocate disk cache automatically.
40- StorageClass string `json:"storageClass,omitempty"`
39+ // Provide storage class to allocate disk cache automatically.
40+ StorageClass string `json:"storageClass,omitempty"`
4141}
4242
4343type LogSpec struct {
44- // Specifications for logging in files.
45- File FileLogSpec `json:"file,omitempty"`
44+ // Specifications for logging in files.
45+ File FileLogSpec `json:"file,omitempty"`
4646
47- // Specifications for stderr logging.
48- Stderr FileLogSpec `json:"stderr,omitempty"`
47+ // Specifications for stderr logging.
48+ Stderr FileLogSpec `json:"stderr,omitempty"`
4949
50- // Specifications for query logging.
51- Query OTLPLogSpec `json:"query,omitempty"`
50+ // Specifications for query logging.
51+ Query OTLPLogSpec `json:"query,omitempty"`
5252
53- // Specifications for profile logging.
54- Profile OTLPLogSpec `json:"profile,omitempty"`
53+ // Specifications for profile logging.
54+ Profile OTLPLogSpec `json:"profile,omitempty"`
5555}
5656
5757type FileLogSpec struct {
58- // Whether to enable file logging.
59- // +kubebuilder:default=false
60- Enabled bool `json:"enabled,omitempty"`
58+ // Whether to enable file logging.
59+ // +kubebuilder:default=false
60+ Enabled bool `json:"enabled,omitempty"`
6161
62- // Log level.
63- Level string `json:"level,omitempty"`
62+ // Log level.
63+ Level string `json:"level,omitempty"`
6464
65- // Path to log directory.
66- Directory string `json:"directory,omitempty"`
65+ // Path to log directory.
66+ Directory string `json:"directory,omitempty"`
6767}
6868
6969type OTLPLogSpec struct {
70- // Whether to enable OTLP logging.
71- // +kubebuilder:default=false
72- Enabled bool `json:"enabled,omitempty"`
70+ // Whether to enable OTLP logging.
71+ // +kubebuilder:default=false
72+ Enabled bool `json:"enabled,omitempty"`
7373
74- // OpenTelemetry Protocol
75- // +kubebuilder:default="http"
76- Protocol string `json:"protocol,omitempty"`
74+ // OpenTelemetry Protocol
75+ // +kubebuilder:default="http"
76+ Protocol string `json:"protocol,omitempty"`
7777
78- // Endpoint for OpenTelemetry Protocol
79- Endpoint string `json:"endpoint,omitempty"`
78+ // Endpoint for OpenTelemetry Protocol
79+ Endpoint string `json:"endpoint,omitempty"`
8080}
8181
8282type WarehouseServiceSpec struct {
83- // Type of service [ClusterIP | NodePort | ExternalName | LoadBalance].
84- // +kubebuilder:default="ClusterIP"
85- Type string `json:"type,omitempty"`
83+ // Type of service [ClusterIP | NodePort | ExternalName | LoadBalance].
84+ // +kubebuilder:default="ClusterIP"
85+ Type string `json:"type,omitempty"`
8686
87- // External name is needed when Type is set to "ExternalName"
88- ExternalName string `json:"externalName,omitempty"`
87+ // External name is needed when Type is set to "ExternalName"
88+ ExternalName string `json:"externalName,omitempty"`
8989}
9090
9191type WarehouseIngressSpec struct {
92- // Annotations for Ingress.
93- Annotations map [string ]string `json:"annotations,omitempty"`
94-
95- // Name of IngressClass.
96- IngressClassName string `json:"ingressClassName,omitempty"`
97-
98- // Host name of ingress.
99- HostName string `json:"hostName,omitempty"`
92+ // Annotations for Ingress.
93+ Annotations map [string ]string `json:"annotations,omitempty"`
94+
95+ // Name of IngressClass.
96+ IngressClassName string `json:"ingressClassName,omitempty"`
97+
98+ // Host name of ingress.
99+ HostName string `json:"hostName,omitempty"`
100100}
101101
102102// WarehouseSpec defines the desired state of Warehouse.
103103type WarehouseSpec struct {
104- // Desired replicas of Query
105- // +kubebuilder:default=1
104+ // Desired replicas of Query
105+ // +kubebuilder:default=1
106106 Replicas int `json:"replicas,omitempty"`
107107
108- // Time for Query clsuter to suspend when no query requests are received.
109- // +kubebuilder:default=1500
108+ // Time for Query clsuter to suspend when no query requests are received.
109+ // +kubebuilder:default=1500
110110 AutoSuspendAfterSecs int `json:"autoSuspendAfterSecs,omitempty"`
111-
112- // Image for Query.
113- QueryImage string `json:"queryImage,omitempty"`
114-
115- // Reference to the Tenant CR, which provides the configuration of storage and Meta cluster.
116- // Warehouse must be created in the Tenant's namespace.
117- Tenant * corev1.LocalObjectReference `json:"tenant,omitempty"`
118-
119- // Configurations of cache in disk.
120- Cache DiskCacheSpec `json:"diskCacheSize,omitempty"`
121-
122- // Configurations of logging.
123- Log LogSpec `json:"log,omitempty"`
124-
125- // Additional labels added to Query pod.
126- PodLabels map [string ]string `json:"labels,omitempty"`
127-
128- // Resource required for each Query pod.
129- PodResource corev1.ResourceRequirements `json:"resourcesPerNode,omitempty"`
130-
131- // Taint tolerations for Query pod.
132- PodTolerations []corev1.Toleration `json:"tolerations,omitempty"`
133-
134- // Node selector for Query pod.
135- NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
136-
137- // Service specifications for Query cluster.
138- Service WarehouseServiceSpec `json:"service,omitempty"`
139-
140- // Ingress specifications for Query cluster.
141- Ingress WarehouseIngressSpec `json:"ingress,omitempty"`
142-
143- // Custom settings that will append to the config file of Query.
144- Settings map [string ]string `json:"settings,omitempty"`
111+
112+ // Image for Query.
113+ QueryImage string `json:"queryImage,omitempty"`
114+
115+ // Reference to the Tenant CR, which provides the configuration of storage and Meta cluster.
116+ // Warehouse must be created in the Tenant's namespace.
117+ Tenant * corev1.LocalObjectReference `json:"tenant,omitempty"`
118+
119+ // Configurations of cache in disk.
120+ Cache DiskCacheSpec `json:"diskCacheSize,omitempty"`
121+
122+ // Configurations of logging.
123+ Log LogSpec `json:"log,omitempty"`
124+
125+ // Additional labels added to Query pod.
126+ PodLabels map [string ]string `json:"labels,omitempty"`
127+
128+ // Resource required for each Query pod.
129+ PodResource corev1.ResourceRequirements `json:"resourcesPerNode,omitempty"`
130+
131+ // Taint tolerations for Query pod.
132+ PodTolerations []corev1.Toleration `json:"tolerations,omitempty"`
133+
134+ // Node selector for Query pod.
135+ NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
136+
137+ // Service specifications for Query cluster.
138+ Service WarehouseServiceSpec `json:"service,omitempty"`
139+
140+ // Ingress specifications for Query cluster.
141+ Ingress WarehouseIngressSpec `json:"ingress,omitempty"`
142+
143+ // Custom settings that will append to the config file of Query.
144+ Settings map [string ]string `json:"settings,omitempty"`
145145}
146146
147147// WarehouseStatus defines the observed state of Warehouse.
148148type WarehouseStatus struct {
149- // Number of the ready Query.
150- ReadyReplicas int `json:"readyReplicas,omitempty"`
151-
152- // Conditions for the Tenant.
149+ // Number of the ready Query.
150+ ReadyReplicas int `json:"readyReplicas,omitempty"`
151+
152+ // Conditions for the Tenant.
153153 // +listType=map
154154 // +listMapKey=type
155155 // +patchStrategy=merge
156156 // +patchMergeKey=type
157- Conditions []metav1.Condition `json:"status,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
157+ Conditions []metav1.Condition `json:"status,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
158158}
159159
160160// +kubebuilder:object:root=true
0 commit comments