Skip to content

Commit 8880c15

Browse files
authored
feat: Enable restart controller (#727)
* feat: Enable restart controller * changelog
1 parent 49185e8 commit 8880c15

File tree

7 files changed

+48
-31
lines changed

7 files changed

+48
-31
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
discovery advertisement, as these should remain stable regardless of listener class used to expose the REST service.
1010
- Support objectOverrides using `.spec.objectOverrides`.
1111
See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#725]).
12+
- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#727]).
1213

1314
### Changed
1415

@@ -18,6 +19,7 @@
1819
[#716]: https://github.com/stackabletech/hbase-operator/pull/716
1920
[#724]: https://github.com/stackabletech/hbase-operator/pull/724
2021
[#725]: https://github.com/stackabletech/hbase-operator/pull/725
22+
[#727]: https://github.com/stackabletech/hbase-operator/pull/727
2123

2224
## [25.11.0] - 2025-11-07
2325

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/hbase-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.101.2", features = ["telemetry", "versioned"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/hbase_controller.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use stackable_operator::{
3030
product_image_selection::{self, ResolvedProductImage},
3131
rbac::build_rbac_resources,
3232
},
33+
constants::RESTART_CONTROLLER_ENABLED_LABEL,
3334
k8s_openapi::{
3435
api::{
3536
apps::v1::{StatefulSet, StatefulSetSpec},
@@ -442,6 +443,10 @@ pub async fn reconcile_hbase(
442443
.with_context(|_| ApplyRoleGroupConfigSnafu {
443444
rolegroup: rolegroup.clone(),
444445
})?;
446+
447+
// Note: The StatefulSet needs to be applied after all ConfigMaps and Secrets it mounts
448+
// to prevent unnecessary Pod restarts.
449+
// See https://github.com/stackabletech/commons-operator/issues/111 for details.
445450
ss_cond_builder.add(
446451
cluster_resources
447452
.add(client, rg_statefulset)
@@ -1095,6 +1100,7 @@ fn build_rolegroup_statefulset(
10951100
&rolegroup_ref.role_group,
10961101
))
10971102
.context(ObjectMetaSnafu)?
1103+
.with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned())
10981104
.build();
10991105

11001106
let statefulset_match_labels = Labels::role_group_selector(

tests/templates/kuttl/smoke/30-assert.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ apiVersion: apps/v1
99
kind: StatefulSet
1010
metadata:
1111
name: test-hbase-master-default
12+
generation: 1 # There should be no unneeded Pod restarts
13+
labels:
14+
restarter.stackable.tech/enabled: "true"
1215
spec:
1316
template:
1417
spec:
@@ -21,6 +24,9 @@ apiVersion: apps/v1
2124
kind: StatefulSet
2225
metadata:
2326
name: test-hbase-regionserver-default
27+
generation: 1 # There should be no unneeded Pod restarts
28+
labels:
29+
restarter.stackable.tech/enabled: "true"
2430
spec:
2531
template:
2632
spec:
@@ -33,6 +39,9 @@ apiVersion: apps/v1
3339
kind: StatefulSet
3440
metadata:
3541
name: test-hbase-restserver-default
42+
generation: 1 # There should be no unneeded Pod restarts
43+
labels:
44+
restarter.stackable.tech/enabled: "true"
3645
spec:
3746
template:
3847
spec:

0 commit comments

Comments
 (0)