Skip to content

Allow specifying extra extensions to enable in Druid #416

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- Deploy default and support custom affinities ([#406]).
- Log aggregation added ([#407]).
- Added the ability to mount extra volumes for files that may be needed for ingestion tasks to work ([#415])
- Add support for specifying additional extensions to enable ([#416])

### Changed

Expand All @@ -30,6 +31,7 @@ All notable changes to this project will be documented in this file.
[#407]: https://github.com/stackabletech/druid-operator/pull/407
[#408]: https://github.com/stackabletech/druid-operator/pull/408
[#415]: https://github.com/stackabletech/druid-operator/pull/415
[#416]: https://github.com/stackabletech/druid-operator/pull/416

## [23.1.0] - 2023-01-23

Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/druid-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,11 @@ spec:
clusterConfig:
description: Common cluster wide configuration that can not differ or be overridden on a role or role group level
properties:
additionalExtensions:
description: Additional extensions to enable in Druid The operator will automatically enable all extensions needed based on the cluster configuration, but for extra functionality which the operator cannot anticipate, it can sometimes be necessary to load additional extensions Anything specified here will be added to the list generated by the operator, not fully replace it.
items:
type: string
type: array
authentication:
default: []
description: List of Authentication classes using like TLS or LDAP to authenticate users
Expand Down
8 changes: 8 additions & 0 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ pub struct DruidClusterConfig {
/// These volumes will be mounted into all pods below `/stackable/userdata/{volumename}`
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extra_volumes: Vec<Volume>,
/// Additional extensions to enable in Druid
/// The operator will automatically enable all extensions needed based on the cluster
/// configuration, but for extra functionality which the operator cannot anticipate, it can
/// sometimes be necessary to load additional extensions
/// Anything specified here will be added to the list generated by the operator, not fully
/// replace it.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub additional_extensions: Vec<String>,
}

/// Common configuration for all role groups
Expand Down
13 changes: 13 additions & 0 deletions rust/operator-binary/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,18 @@ pub fn get_extension_list(
extensions.push(EXT_S3.to_string());
}

// Add user specified extensions to the list of loaded extensions if any are present
for additional_extension in &druid.spec.cluster_config.additional_extensions {
if extensions.contains(additional_extension) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O(n^2) here we come :) Just kidding, you could use a BTreeMap - feel free to ignore

tracing::warn!("Skipping user specified extension [{additional_extension}] as it was already added to the extensions.");
} else {
tracing::info!(
"Adding user specified extension [{additional_extension}] to list of enabled extensions."
);
extensions.push(additional_extension.to_string());
}
}

tracing::debug!(?extensions, "Finished generating extension list",);
extensions
}