Skip to content

Commit 536a8c7

Browse files
committed
chore: Version DruidClusterConfig
1 parent d6375ac commit 536a8c7

File tree

3 files changed

+80
-80
lines changed

3 files changed

+80
-80
lines changed

rust/operator-binary/src/crd/authentication.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use stackable_operator::{
1212
};
1313
use tracing::info;
1414

15-
use crate::crd::DruidClusterConfig;
15+
use crate::crd::v1alpha1::DruidClusterConfig;
1616

1717
type Result<T, E = Error> = std::result::Result<T, E>;
1818

@@ -230,7 +230,7 @@ mod tests {
230230
use stackable_operator::kube;
231231

232232
use super::*;
233-
use crate::crd::{authentication::AuthenticationClassesResolved, DruidClusterConfig};
233+
use crate::crd::{authentication::AuthenticationClassesResolved, v1alpha1::DruidClusterConfig};
234234

235235
const BASE_CLUSTER_CONFIG: &str = r#"
236236
deepStorage:

rust/operator-binary/src/crd/mod.rs

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub mod versioned {
202202
#[serde(rename_all = "camelCase")]
203203
pub struct DruidClusterSpec {
204204
/// Common cluster wide configuration that can not differ or be overridden on a role or role group level.
205-
pub cluster_config: DruidClusterConfig,
205+
pub cluster_config: v1alpha1::DruidClusterConfig,
206206

207207
// no doc - docs provided by the struct.
208208
pub image: ProductImage,
@@ -226,6 +226,82 @@ pub mod versioned {
226226
#[serde(default)]
227227
pub cluster_operation: ClusterOperation,
228228
}
229+
230+
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)]
231+
#[serde(rename_all = "camelCase")]
232+
pub struct DruidClusterConfig {
233+
/// Additional extensions to load in Druid.
234+
/// The operator will automatically load all extensions needed based on the cluster
235+
/// configuration, but for extra functionality which the operator cannot anticipate, it can
236+
/// sometimes be necessary to load additional extensions.
237+
/// Add configuration for additional extensions using [configuration override for Druid](https://docs.stackable.tech/home/stable/druid/usage-guide/configuration-and-environment-overrides).
238+
#[serde(default)]
239+
pub additional_extensions: HashSet<String>,
240+
241+
/// List of [AuthenticationClasses](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication)
242+
/// to use for authenticating users. TLS, LDAP and OIDC authentication are supported. More information in
243+
/// the [Druid operator security documentation](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/security#_authentication).
244+
///
245+
/// For TLS: Please note that the SecretClass used to authenticate users needs to be the same
246+
/// as the SecretClass used for internal communication.
247+
#[serde(default)]
248+
pub authentication: Vec<ClientAuthenticationDetails>,
249+
250+
/// Authorization settings for Druid like OPA
251+
#[serde(skip_serializing_if = "Option::is_none")]
252+
pub authorization: Option<DruidAuthorization>,
253+
254+
/// [Druid deep storage configuration](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/deep-storage).
255+
/// Only one backend can be used at a time. Either HDFS or S3 are supported.
256+
pub deep_storage: DeepStorageSpec,
257+
258+
/// Configuration properties for data ingestion tasks.
259+
#[serde(skip_serializing_if = "Option::is_none")]
260+
pub ingestion: Option<IngestionSpec>,
261+
262+
/// Druid requires an SQL database to store metadata into. Specify connection information here.
263+
pub metadata_storage_database: DatabaseConnectionSpec,
264+
265+
/// TLS encryption settings for Druid, more information in the
266+
/// [security documentation](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/security).
267+
/// This setting only affects server and internal communication.
268+
/// It does not affect client tls authentication, use `clusterConfig.authentication` instead.
269+
#[serde(default = "default_druid_tls", skip_serializing_if = "Option::is_none")]
270+
pub tls: Option<DruidTls>,
271+
272+
/// Druid requires a ZooKeeper cluster connection to run.
273+
/// Provide the name of the ZooKeeper [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery)
274+
/// here. When using the [Stackable operator for Apache ZooKeeper](DOCS_BASE_URL_PLACEHOLDER/zookeeper/)
275+
/// to deploy a ZooKeeper cluster, this will simply be the name of your ZookeeperCluster resource.
276+
pub zookeeper_config_map_name: String,
277+
278+
/// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery).
279+
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.
280+
/// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator)
281+
/// to learn how to configure log aggregation with Vector.
282+
#[serde(skip_serializing_if = "Option::is_none")]
283+
pub vector_aggregator_config_map_name: Option<String>,
284+
285+
/// Extra volumes similar to `.spec.volumes` on a Pod to mount into every container, this can be useful to for
286+
/// example make client certificates, keytabs or similar things available to processors. These volumes will be
287+
/// mounted into all pods at `/stackable/userdata/{volumename}`.
288+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
289+
#[schemars(schema_with = "raw_object_list_schema")]
290+
pub extra_volumes: Vec<Volume>,
291+
292+
/// This field controls which type of Service the Operator creates for this DruidCluster:
293+
///
294+
/// * `cluster-internal`: Use a ClusterIP service
295+
/// * `external-unstable`: Use a NodePort service
296+
/// * `external-stable`: Use a LoadBalancer service
297+
///
298+
/// This is a temporary solution with the goal to keep yaml manifests forward compatible.
299+
/// In the future, this setting will control which
300+
/// [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html)
301+
/// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
302+
#[serde(default)]
303+
pub listener_class: CurrentlySupportedListenerClasses,
304+
}
229305
}
230306

231307
#[derive(
@@ -249,82 +325,6 @@ pub enum Container {
249325
Vector,
250326
}
251327

252-
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)]
253-
#[serde(rename_all = "camelCase")]
254-
pub struct DruidClusterConfig {
255-
/// Additional extensions to load in Druid.
256-
/// The operator will automatically load all extensions needed based on the cluster
257-
/// configuration, but for extra functionality which the operator cannot anticipate, it can
258-
/// sometimes be necessary to load additional extensions.
259-
/// Add configuration for additional extensions using [configuration override for Druid](https://docs.stackable.tech/home/stable/druid/usage-guide/configuration-and-environment-overrides).
260-
#[serde(default)]
261-
pub additional_extensions: HashSet<String>,
262-
263-
/// List of [AuthenticationClasses](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication)
264-
/// to use for authenticating users. TLS, LDAP and OIDC authentication are supported. More information in
265-
/// the [Druid operator security documentation](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/security#_authentication).
266-
///
267-
/// For TLS: Please note that the SecretClass used to authenticate users needs to be the same
268-
/// as the SecretClass used for internal communication.
269-
#[serde(default)]
270-
pub authentication: Vec<ClientAuthenticationDetails>,
271-
272-
/// Authorization settings for Druid like OPA
273-
#[serde(skip_serializing_if = "Option::is_none")]
274-
pub authorization: Option<DruidAuthorization>,
275-
276-
/// [Druid deep storage configuration](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/deep-storage).
277-
/// Only one backend can be used at a time. Either HDFS or S3 are supported.
278-
pub deep_storage: DeepStorageSpec,
279-
280-
/// Configuration properties for data ingestion tasks.
281-
#[serde(skip_serializing_if = "Option::is_none")]
282-
pub ingestion: Option<IngestionSpec>,
283-
284-
/// Druid requires an SQL database to store metadata into. Specify connection information here.
285-
pub metadata_storage_database: DatabaseConnectionSpec,
286-
287-
/// TLS encryption settings for Druid, more information in the
288-
/// [security documentation](DOCS_BASE_URL_PLACEHOLDER/druid/usage-guide/security).
289-
/// This setting only affects server and internal communication.
290-
/// It does not affect client tls authentication, use `clusterConfig.authentication` instead.
291-
#[serde(default = "default_druid_tls", skip_serializing_if = "Option::is_none")]
292-
pub tls: Option<DruidTls>,
293-
294-
/// Druid requires a ZooKeeper cluster connection to run.
295-
/// Provide the name of the ZooKeeper [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery)
296-
/// here. When using the [Stackable operator for Apache ZooKeeper](DOCS_BASE_URL_PLACEHOLDER/zookeeper/)
297-
/// to deploy a ZooKeeper cluster, this will simply be the name of your ZookeeperCluster resource.
298-
pub zookeeper_config_map_name: String,
299-
300-
/// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery).
301-
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.
302-
/// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator)
303-
/// to learn how to configure log aggregation with Vector.
304-
#[serde(skip_serializing_if = "Option::is_none")]
305-
pub vector_aggregator_config_map_name: Option<String>,
306-
307-
/// Extra volumes similar to `.spec.volumes` on a Pod to mount into every container, this can be useful to for
308-
/// example make client certificates, keytabs or similar things available to processors. These volumes will be
309-
/// mounted into all pods at `/stackable/userdata/{volumename}`.
310-
#[serde(default, skip_serializing_if = "Vec::is_empty")]
311-
#[schemars(schema_with = "raw_object_list_schema")]
312-
pub extra_volumes: Vec<Volume>,
313-
314-
/// This field controls which type of Service the Operator creates for this DruidCluster:
315-
///
316-
/// * `cluster-internal`: Use a ClusterIP service
317-
/// * `external-unstable`: Use a NodePort service
318-
/// * `external-stable`: Use a LoadBalancer service
319-
///
320-
/// This is a temporary solution with the goal to keep yaml manifests forward compatible.
321-
/// In the future, this setting will control which
322-
/// [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html)
323-
/// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
324-
#[serde(default)]
325-
pub listener_class: CurrentlySupportedListenerClasses,
326-
}
327-
328328
// TODO: Temporary solution until listener-operator is finished
329329
#[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
330330
#[serde(rename_all = "PascalCase")]

rust/operator-binary/src/crd/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn tls_default() -> Option<String> {
3333
mod tests {
3434
use indoc::formatdoc;
3535

36-
use crate::crd::{tests::deserialize_yaml_str, tls::DruidTls, DruidClusterConfig};
36+
use crate::crd::{tests::deserialize_yaml_str, tls::DruidTls, v1alpha1::DruidClusterConfig};
3737

3838
const BASE_DRUID_CONFIGURATION: &str = r#"
3939
deepStorage:

0 commit comments

Comments
 (0)