Skip to content

Commit 99effb0

Browse files
authored
feat: run containerdebug in the background (#605)
* feat: run containerdebug in the background * cargo update * remove unused env var * reintroduce the CONTAINERDEBUG_LOG_DIRECTORY env var * factor out ctnrdebug test * up test memory from @nightkr
1 parent 142269e commit 99effb0

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- The lifetime of auto generated TLS certificates is now configurable with the role and roleGroup
88
config property `requestedSecretLifetime`. This helps reducing frequent Pod restarts ([#598]).
9+
- Run a `containerdebug` process in the background of each HBase container to collect debugging information ([#605]).
910

1011
### Fixed
1112

@@ -15,6 +16,7 @@
1516

1617
[#594]: https://github.com/stackabletech/hbase-operator/pull/594
1718
[#598]: https://github.com/stackabletech/hbase-operator/pull/598
19+
[#605]: https://github.com/stackabletech/hbase-operator/pull/605
1820

1921
## [24.11.0] - 2024-11-18
2022

rust/operator-binary/src/hbase_controller.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ fn build_rolegroup_statefulset(
881881
{COMMON_BASH_TRAP_FUNCTIONS}
882882
{remove_vector_shutdown_file_command}
883883
prepare_signal_handlers
884+
containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &
884885
bin/hbase {hbase_role_name_in_command} start &
885886
wait_for_termination $!
886887
{create_vector_shutdown_file_command}
@@ -893,6 +894,11 @@ fn build_rolegroup_statefulset(
893894
create_vector_shutdown_file_command(STACKABLE_LOG_DIR),
894895
}])
895896
.add_env_vars(merged_env)
897+
// Needed for the `containerdebug` process to log it's tracing information to.
898+
.add_env_var(
899+
"CONTAINERDEBUG_LOG_DIRECTORY",
900+
format!("{STACKABLE_LOG_DIR}/containerdebug"),
901+
)
896902
.add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR)
897903
.context(AddVolumeMountSnafu)?
898904
.add_volume_mount("hdfs-discovery", HDFS_DISCOVERY_TMP_DIR)

tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ commands:
3939
config:
4040
logging:
4141
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
42+
resources:
43+
memory:
44+
limit: 1536Mi
4245
roleGroups:
4346
default:
4447
replicas: 2

tests/templates/kuttl/smoke/30-install-hbase.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ spec:
4545
config:
4646
logging:
4747
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
48+
resources:
49+
memory:
50+
limit: 1Gi
4851
roleGroups:
4952
default:
5053
configOverrides:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# This test checks if the containerdebug-state.json file is present and valid
3+
apiVersion: kuttl.dev/v1beta1
4+
kind: TestAssert
5+
timeout: 600
6+
commands:
7+
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-master-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'
8+
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-regionserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'
9+
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-restserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'

0 commit comments

Comments
 (0)