Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run containerdebug in the background #605

Merged
merged 9 commits into from
Dec 19, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- The lifetime of auto generated TLS certificates is now configurable with the role and roleGroup
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]).

### Fixed

Expand All @@ -15,6 +16,7 @@

[#594]: https://github.com/stackabletech/hbase-operator/pull/594
[#598]: https://github.com/stackabletech/hbase-operator/pull/598
[#605]: https://github.com/stackabletech/hbase-operator/pull/605

## [24.11.0] - 2024-11-18

Expand Down
6 changes: 6 additions & 0 deletions rust/operator-binary/src/hbase_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ fn build_rolegroup_statefulset(
{COMMON_BASH_TRAP_FUNCTIONS}
{remove_vector_shutdown_file_command}
prepare_signal_handlers
containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &
bin/hbase {hbase_role_name_in_command} start &
wait_for_termination $!
{create_vector_shutdown_file_command}
Expand All @@ -893,6 +894,11 @@ fn build_rolegroup_statefulset(
create_vector_shutdown_file_command(STACKABLE_LOG_DIR),
}])
.add_env_vars(merged_env)
// Needed for the `containerdebug` process to log it's tracing information to.
.add_env_var(
"CONTAINERDEBUG_LOG_DIRECTORY",
format!("{STACKABLE_LOG_DIR}/containerdebug"),
)
.add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR)
.context(AddVolumeMountSnafu)?
.add_volume_mount("hdfs-discovery", HDFS_DISCOVERY_TMP_DIR)
Expand Down
3 changes: 3 additions & 0 deletions tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ commands:
config:
logging:
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
resources:
memory:
limit: 1536Mi
roleGroups:
default:
replicas: 2
Expand Down
3 changes: 3 additions & 0 deletions tests/templates/kuttl/smoke/30-install-hbase.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ spec:
config:
logging:
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
resources:
memory:
limit: 1Gi
roleGroups:
default:
configOverrides:
Expand Down
9 changes: 9 additions & 0 deletions tests/templates/kuttl/smoke/31-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# This test checks if the containerdebug-state.json file is present and valid
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
commands:
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-master-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-regionserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'
- script: kubectl exec -n $NAMESPACE --container hbase test-hbase-restserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valif JSON"'
Loading