Skip to content
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

[Merged by Bors] - Increase the size limit of log volumes. #452

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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ All notable changes to this project will be documented in this file.

### Changed

- Operator-rs: `0.42.2` -> `0.44.0` ([#452]).
- Use 0.0.0-dev product images for tests and examples ([#435])
- Use testing-tools 0.2.0 ([#435])
- Tls tests now run on OpenShift ([#445])
- Added kuttl test suites ([#447])
- Increase the size limit of log volumes (#[452])

### Removed

Expand All @@ -32,6 +34,7 @@ All notable changes to this project will be documented in this file.
[#445]: https://github.com/stackabletech/druid-operator/pull/445
[#447]: https://github.com/stackabletech/druid-operator/pull/447
[#450]: https://github.com/stackabletech/druid-operator/pull/450
[#452]: https://github.com/stackabletech/druid-operator/pull/452

## [23.4.0] - 2023-04-17

Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = "0.0.0-dev"
publish = false

[dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" }

semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
9 changes: 5 additions & 4 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use stackable_operator::{
},
kube::{CustomResource, ResourceExt},
labels::ObjectLabels,
memory::{BinaryMultiple, MemoryQuantity},
product_config::types::PropertyNameKind,
product_config_utils::{ConfigError, Configuration},
product_logging::{self, spec::Logging},
Expand Down Expand Up @@ -109,10 +110,10 @@ pub const PROCESSING_NUM_THREADS: &str = "druid.processing.numThreads";
// extra
pub const CREDENTIALS_SECRET_PROPERTY: &str = "credentialsSecret";
// logs
pub const MAX_DRUID_LOG_FILES_SIZE_IN_MIB: u32 = 10;
const MAX_PREPARE_LOG_FILE_SIZE_IN_MIB: u32 = 1;
pub const LOG_VOLUME_SIZE_IN_MIB: u32 =
MAX_DRUID_LOG_FILES_SIZE_IN_MIB + MAX_PREPARE_LOG_FILE_SIZE_IN_MIB;
pub const MAX_DRUID_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity {
value: 10.0,
unit: BinaryMultiple::Mebi,
};
// metrics
pub const PROMETHEUS_PORT: &str = "druid.emitter.prometheus.port";
pub const METRICS_PORT: u16 = 9090;
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = "0.0.0-dev"
publish = false

[dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" }
stackable-druid-crd = { path = "../crd" }
anyhow = "1.0"
clap = "4.1"
Expand All @@ -30,7 +30,7 @@ lazy_static = "1.4"

[build-dependencies]
built = { version = "0.6", features = ["chrono", "git2"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" }
stackable-druid-crd = { path = "../crd" }

[dev-dependencies]
Expand Down
8 changes: 5 additions & 3 deletions rust/operator-binary/src/druid_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use stackable_druid_crd::{
CommonRoleGroupConfig, Container, DeepStorageSpec, DruidCluster, DruidClusterStatus, DruidRole,
APP_NAME, AUTH_AUTHORIZER_OPA_URI, CERTS_DIR, CREDENTIALS_SECRET_PROPERTY,
DRUID_CONFIG_DIRECTORY, DS_BUCKET, ENV_INTERNAL_SECRET, EXTENSIONS_LOADLIST,
HDFS_CONFIG_DIRECTORY, JVM_CONFIG, LOG_CONFIG_DIRECTORY, LOG_DIR, LOG_VOLUME_SIZE_IN_MIB,
HDFS_CONFIG_DIRECTORY, JVM_CONFIG, LOG_CONFIG_DIRECTORY, LOG_DIR, MAX_DRUID_LOG_FILES_SIZE,
RUNTIME_PROPS, RW_CONFIG_DIRECTORY, S3_ENDPOINT_URL, S3_PATH_STYLE_ACCESS, S3_SECRET_DIR_NAME,
ZOOKEEPER_CONNECTION_STRING,
};
Expand All @@ -42,7 +42,7 @@ use stackable_operator::{
apps::v1::{StatefulSet, StatefulSetSpec},
core::v1::{ConfigMap, EnvVar, Service, ServiceSpec},
},
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::LabelSelector},
apimachinery::pkg::apis::meta::v1::LabelSelector,
},
kube::{
runtime::{controller::Action, reflector::ObjectRef},
Expand Down Expand Up @@ -1033,7 +1033,9 @@ fn add_log_volume_and_volume_mounts(
VolumeBuilder::new(LOG_VOLUME_NAME)
.with_empty_dir(
Some(""),
Some(Quantity(format!("{LOG_VOLUME_SIZE_IN_MIB}Mi"))),
Some(product_logging::framework::calculate_log_volume_size_limit(
&[MAX_DRUID_LOG_FILES_SIZE],
)),
)
.build(),
);
Expand Down
9 changes: 6 additions & 3 deletions rust/operator-binary/src/product_logging.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_druid_crd::{
Container, DruidCluster, DRUID_LOG_FILE, LOG4J2_CONFIG, LOG_DIR,
MAX_DRUID_LOG_FILES_SIZE_IN_MIB,
Container, DruidCluster, DRUID_LOG_FILE, LOG4J2_CONFIG, LOG_DIR, MAX_DRUID_LOG_FILES_SIZE,
};
use stackable_operator::{
builder::ConfigMapBuilder,
client::Client,
k8s_openapi::api::core::v1::ConfigMap,
kube::ResourceExt,
memory::BinaryMultiple,
product_logging::{
self,
spec::{ContainerLogConfig, ContainerLogConfigChoice, Logging},
Expand Down Expand Up @@ -92,7 +92,10 @@ pub fn extend_role_group_config_map(
product_logging::framework::create_log4j2_config(
&format!("{LOG_DIR}/{container}", container = Container::Druid),
DRUID_LOG_FILE,
MAX_DRUID_LOG_FILES_SIZE_IN_MIB,
MAX_DRUID_LOG_FILES_SIZE
.scale_to(BinaryMultiple::Mebi)
.floor()
.value as u32,
CONSOLE_CONVERSION_PATTERN,
log_config,
),
Expand Down