Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Added

- The operator can now run on Kubernetes clusters using a non-default cluster domain. It should automatically detect the
correct domain to use, but you can also use the env var `KUBERNETES_CLUSTER_DOMAIN` to set the domain explicitly
or use the helm-chart property `kubernetesClusterDomain` ([#574]).

### Changed

- Reduce CRD size from `1.4MB` to `96KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#548]):
Expand All @@ -21,6 +27,7 @@
[#550]: https://github.com/stackabletech/hbase-operator/pull/550
[#556]: https://github.com/stackabletech/hbase-operator/pull/556
[#558]: https://github.com/stackabletech/hbase-operator/pull/558
[#574]: https://github.com/stackabletech/hbase-operator/pull/574

## [24.7.0] - 2024-07-24

Expand Down
54 changes: 34 additions & 20 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ clap = "4.5"
fnv = "1.0"
futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
rstest = "0.22"
rstest = "0.23"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.76.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.79.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/hbase-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ nodeSelector: {}
tolerations: []

affinity: {}

# When running on a non-default Kubernetes cluster domain and the auto detections is not working correctly,
# you can set your custom cluster domain here.
# See the https://docs.stackable.tech/home/stable/guides/kubernetes-cluster-domain guide for details
# kubernetesClusterDomain: my-cluster.local
86 changes: 57 additions & 29 deletions rust/operator-binary/src/hbase_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use product_config::{
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::{
builder::{
self,
configmap::ConfigMapBuilder,
meta::ObjectMetaBuilder,
pod::{
Expand Down Expand Up @@ -45,7 +46,9 @@ use stackable_operator::{
product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config},
product_logging::{
self,
framework::{create_vector_shutdown_file_command, remove_vector_shutdown_file_command},
framework::{
create_vector_shutdown_file_command, remove_vector_shutdown_file_command, LoggingError,
},
spec::{
ConfigMapLogConfig, ContainerLogConfig, ContainerLogConfigChoice,
CustomContainerLogConfig,
Expand Down Expand Up @@ -291,6 +294,17 @@ pub enum Error {

#[snafu(display("authorization is only supported from HBase 2.6 onwards"))]
AuthorizationNotSupported,

#[snafu(display("failed to configure logging"))]
ConfigureLogging { source: LoggingError },

#[snafu(display("failed to add needed volume"))]
AddVolume { source: builder::pod::Error },

#[snafu(display("failed to add needed volumeMount"))]
AddVolumeMount {
source: builder::pod::container::Error,
},
}

type Result<T, E = Error> = std::result::Result<T, E>;
Expand Down Expand Up @@ -859,9 +873,13 @@ fn build_rolegroup_statefulset(
}])
.add_env_vars(merged_env)
.add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR)
.context(AddVolumeMountSnafu)?
.add_volume_mount("hdfs-discovery", HDFS_DISCOVERY_TMP_DIR)
.context(AddVolumeMountSnafu)?
.add_volume_mount("log-config", HBASE_LOG_CONFIG_TMP_DIR)
.context(AddVolumeMountSnafu)?
.add_volume_mount("log", STACKABLE_LOG_DIR)
.context(AddVolumeMountSnafu)?
.add_container_ports(ports)
.resources(config.resources.clone().into())
.startup_probe(startup_probe)
Expand Down Expand Up @@ -892,6 +910,7 @@ fn build_rolegroup_statefulset(
}),
..Default::default()
})
.context(AddVolumeSnafu)?
.add_volume(stackable_operator::k8s_openapi::api::core::v1::Volume {
name: "hdfs-discovery".to_string(),
config_map: Some(ConfigMapVolumeSource {
Expand All @@ -900,12 +919,14 @@ fn build_rolegroup_statefulset(
}),
..Default::default()
})
.context(AddVolumeSnafu)?
.add_empty_dir_volume(
"log",
Some(product_logging::framework::calculate_log_volume_size_limit(
&[MAX_HBASE_LOG_FILES_SIZE],
)),
)
.context(AddVolumeSnafu)?
.service_account_name(service_account_name(APP_NAME))
.security_context(
PodSecurityContextBuilder::new()
Expand All @@ -922,23 +943,27 @@ fn build_rolegroup_statefulset(
})),
}) = config.logging.containers.get(&Container::Hbase)
{
pod_builder.add_volume(Volume {
name: "log-config".to_string(),
config_map: Some(ConfigMapVolumeSource {
name: config_map.into(),
..ConfigMapVolumeSource::default()
}),
..Volume::default()
});
pod_builder
.add_volume(Volume {
name: "log-config".to_string(),
config_map: Some(ConfigMapVolumeSource {
name: config_map.into(),
..ConfigMapVolumeSource::default()
}),
..Volume::default()
})
.context(AddVolumeSnafu)?;
} else {
pod_builder.add_volume(Volume {
name: "log-config".to_string(),
config_map: Some(ConfigMapVolumeSource {
name: rolegroup_ref.object_name(),
..ConfigMapVolumeSource::default()
}),
..Volume::default()
});
pod_builder
.add_volume(Volume {
name: "log-config".to_string(),
config_map: Some(ConfigMapVolumeSource {
name: rolegroup_ref.object_name(),
..ConfigMapVolumeSource::default()
}),
..Volume::default()
})
.context(AddVolumeSnafu)?;
}

add_graceful_shutdown_config(config, &mut pod_builder).context(GracefulShutdownSnafu)?;
Expand All @@ -950,18 +975,21 @@ fn build_rolegroup_statefulset(

// Vector sidecar shall be the last container in the list
if config.logging.enable_vector_agent {
pod_builder.add_container(product_logging::framework::vector_container(
resolved_product_image,
"hbase-config",
"log",
config.logging.containers.get(&Container::Vector),
ResourceRequirementsBuilder::new()
.with_cpu_request("250m")
.with_cpu_limit("500m")
.with_memory_request("128Mi")
.with_memory_limit("128Mi")
.build(),
));
pod_builder.add_container(
product_logging::framework::vector_container(
resolved_product_image,
"hbase-config",
"log",
config.logging.containers.get(&Container::Vector),
ResourceRequirementsBuilder::new()
.with_cpu_request("250m")
.with_cpu_limit("500m")
.with_memory_request("128Mi")
.with_memory_limit("128Mi")
.build(),
)
.context(ConfigureLoggingSnafu)?,
);
}

let mut pod_template = pod_builder.build_template();
Expand Down
Loading
Loading