Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
config property `requestedSecretLifetime`. This helps reducing frequent Pod restarts ([#598]).
- Run a `containerdebug` process in the background of each HBase container to collect debugging information ([#605]).
- Aggregate emitted Kubernetes events on the CustomResources ([#612]).
- Support configuring JVM arguments ([#620]).

### Removed

- BREAKING: The field `config.hbaseOpts` has been removed. Use JVM argument overrides instead to configure additional JVM arguments ([#620]).

### Changed

Expand All @@ -17,6 +22,7 @@
[#605]: https://github.com/stackabletech/hbase-operator/pull/605
[#611]: https://github.com/stackabletech/hbase-operator/pull/611
[#612]: https://github.com/stackabletech/hbase-operator/pull/612
[#620]: https://github.com/stackabletech/hbase-operator/pull/620

## [24.11.1] - 2025-01-09

Expand Down
174 changes: 156 additions & 18 deletions deploy/helm/hbase-operator/crds/crds.yaml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions docs/modules/hbase/pages/usage-guide/overrides.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,21 @@ The HBaseCluster Stacklet does not support environment variable overrides with t

The HBase Stacklet and operator also support Pod overrides, allowing you to override any property that you can set on a Kubernetes Pod.
Read the xref:concepts:overrides.adoc#pod-overrides[Pod overrides documentation] to learn more about this feature.

== JVM argument overrides

Stackable operators automatically determine the set of needed JVM arguments, such as memory settings or trust- and keystores.
Using JVM argument overrides you can configure the JVM arguments xref:concepts:overrides.adoc#jvm-argument-overrides[according to the concepts page].

One thing that is different for Kafka, is that all heap-related arguments will be passed in via the env variable `HBASE_HEAPSIZE`, all the other ones via `HBASE_OPTS`, `HBASE_MASTER_OPTS`, `HBASE_REGIONSERVER_OPTS` and `HBASE_REST_OPTS`.
The `HBASE_HEAPSIZE` variable is documented as follows in the https://cwiki.apache.org/confluence/display/HADOOP2/Hbase+FAQ+Operations[HBase FAQs]:

> Set the HBASE_HEAPSIZE environment variable in ${HBASE_HOME}/conf/hbase-env.sh if your install needs to run with a larger heap.
> HBASE_HEAPSIZE is like HADOOP_HEAPSIZE in that its value is the desired heap size in MB.
> The surrounding '-Xmx' and 'm' needed to make up the maximum heap size java option are added by the hbase start script
> (See how HBASE_HEAPSIZE is used in the ${HBASE_HOME}/bin/hbase script for clarification).

Looking at `bin/hbase`, you can actually add the `m` suffix to make the unit more clear, the script will detect this https://github.com/apache/hbase/blob/777010361abb203b8b17673d84acf4f7f1d0283a/bin/hbase#L165[here] and work correctly.

Because of this, it is not possible to change `-XmS` and `-XmX` via JVM argument overrides.
You need to envOverride `HBASE_HEAPSIZE` instead.
31 changes: 12 additions & 19 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ use stackable_operator::{
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
product_config_utils::Configuration,
product_logging::{self, spec::Logging},
role_utils::{
GenericProductSpecificCommonConfig, GenericRoleConfig, Role, RoleGroup, RoleGroupRef,
},
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef},
schemars::{self, JsonSchema},
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
Expand Down Expand Up @@ -51,16 +49,10 @@ pub const HBASE_SITE_XML: &str = "hbase-site.xml";
pub const SSL_SERVER_XML: &str = "ssl-server.xml";
pub const SSL_CLIENT_XML: &str = "ssl-client.xml";

pub const HBASE_MANAGES_ZK: &str = "HBASE_MANAGES_ZK";
pub const HBASE_MASTER_OPTS: &str = "HBASE_MASTER_OPTS";
pub const HBASE_REGIONSERVER_OPTS: &str = "HBASE_REGIONSERVER_OPTS";
pub const HBASE_REST_OPTS: &str = "HBASE_REST_OPTS";

pub const HBASE_CLUSTER_DISTRIBUTED: &str = "hbase.cluster.distributed";
pub const HBASE_ROOTDIR: &str = "hbase.rootdir";
pub const HBASE_UNSAFE_REGIONSERVER_HOSTNAME_DISABLE_MASTER_REVERSEDNS: &str =
"hbase.unsafe.regionserver.hostname.disable.master.reversedns";
pub const HBASE_HEAPSIZE: &str = "HBASE_HEAPSIZE";

pub const HBASE_UI_PORT_NAME_HTTP: &str = "ui-http";
pub const HBASE_UI_PORT_NAME_HTTPS: &str = "ui-https";
Expand All @@ -81,8 +73,6 @@ pub const HBASE_REST_UI_PORT: u16 = 8085;
// Newer versions use the same port as the UI because Hbase provides it's own metrics API
pub const METRICS_PORT: u16 = 9100;

pub const JVM_HEAP_FACTOR: f32 = 0.8;

#[derive(Snafu, Debug)]
pub enum Error {
#[snafu(display("the role [{role}] is invalid and does not exist in HBase"))]
Expand Down Expand Up @@ -137,15 +127,15 @@ pub struct HbaseClusterSpec {
/// The HBase master process is responsible for assigning regions to region servers and
/// manages the cluster.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub masters: Option<Role<HbaseConfigFragment>>,
pub masters: Option<Role<HbaseConfigFragment, GenericRoleConfig, JavaCommonConfig>>,

/// Region servers hold the data and handle requests from clients for their region.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region_servers: Option<Role<HbaseConfigFragment>>,
pub region_servers: Option<Role<HbaseConfigFragment, GenericRoleConfig, JavaCommonConfig>>,

/// Rest servers provide a REST API to interact with.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rest_servers: Option<Role<HbaseConfigFragment>>,
pub rest_servers: Option<Role<HbaseConfigFragment, GenericRoleConfig, JavaCommonConfig>>,
}

#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
Expand Down Expand Up @@ -325,7 +315,6 @@ impl HbaseRole {

HbaseConfigFragment {
hbase_rootdir: None,
hbase_opts: None,
resources,
logging: product_logging::spec::default_logging(),
affinity: get_affinity(cluster_name, self, hdfs_discovery_cm_name),
Expand Down Expand Up @@ -413,12 +402,13 @@ pub enum Container {
pub struct HbaseConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hbase_rootdir: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hbase_opts: Option<String>,

#[fragment_attrs(serde(default))]
pub resources: Resources<HbaseStorageConfig, NoRuntimeLimits>,

#[fragment_attrs(serde(default))]
pub logging: Logging<Container>,

#[fragment_attrs(serde(default))]
pub affinity: StackableAffinity,

Expand Down Expand Up @@ -538,7 +528,10 @@ impl HbaseCluster {
}
}

pub fn get_role(&self, role: &HbaseRole) -> Option<&Role<HbaseConfigFragment>> {
pub fn get_role(
&self,
role: &HbaseRole,
) -> Option<&Role<HbaseConfigFragment, GenericRoleConfig, JavaCommonConfig>> {
match role {
HbaseRole::Master => self.spec.masters.as_ref(),
HbaseRole::RegionServer => self.spec.region_servers.as_ref(),
Expand All @@ -550,7 +543,7 @@ impl HbaseCluster {
pub fn get_role_group(
&self,
rolegroup_ref: &RoleGroupRef<HbaseCluster>,
) -> Result<&RoleGroup<HbaseConfigFragment, GenericProductSpecificCommonConfig>, Error> {
) -> Result<&RoleGroup<HbaseConfigFragment, JavaCommonConfig>, Error> {
let role_variant =
HbaseRole::from_str(&rolegroup_ref.role).with_context(|_| InvalidRoleSnafu {
role: rolegroup_ref.role.to_owned(),
Expand Down
Loading
Loading