Skip to content

Commit aa74553

Browse files
committed
feat: run containerdebug in the background
1 parent 98c545c commit aa74553

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
- The lifetime of auto generated TLS certificates is now configurable with the role and roleGroup
1010
config property `requestedSecretLifetime`. This helps reducing frequent Pod restarts ([#619]).
11+
- Run a `containerdebug` process in the background of each HDFS container to collect debugging information ([#629]).
1112

1213
### Fixed
1314

@@ -17,6 +18,7 @@ All notable changes to this project will be documented in this file.
1718

1819
[#616]: https://github.com/stackabletech/hdfs-operator/pull/616
1920
[#619]: https://github.com/stackabletech/hdfs-operator/pull/619
21+
[#629]: https://github.com/stackabletech/hdfs-operator/pull/629
2022

2123
## [24.11.0] - 2024-11-18
2224

rust/operator-binary/src/container.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ impl ContainerConfig {
612612
{COMMON_BASH_TRAP_FUNCTIONS}
613613
{remove_vector_shutdown_file_command}
614614
prepare_signal_handlers
615+
CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &
615616
if [[ -d {LISTENER_VOLUME_DIR} ]]; then
616617
export POD_ADDRESS=$(cat {LISTENER_VOLUME_DIR}/default-address/address)
617618
for i in {LISTENER_VOLUME_DIR}/default-address/ports/*; do

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,12 @@ status:
143143
expectedPods: {{ test_scenario['values']['number-of-datanodes'] }}
144144
currentHealthy: {{ test_scenario['values']['number-of-datanodes'] }}
145145
disruptionsAllowed: 1
146+
---
147+
# This test checks if the containerdebug-state.json file is present and valid
148+
apiVersion: kuttl.dev/v1beta1
149+
kind: TestAssert
150+
timeout: 600
151+
commands:
152+
- script: kubectl exec -n $NAMESPACE --container namenode hdfs-namenode-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
153+
- script: kubectl exec -n $NAMESPACE --container datanode hdfs-datanode-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
154+
- script: kubectl exec -n $NAMESPACE --container journalnode hdfs-journalnode-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status

0 commit comments

Comments
 (0)