diff --git a/CHANGELOG.md b/CHANGELOG.md index f55d5853..8e49f8ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - The lifetime of auto generated TLS certificates is now configurable with the role and roleGroup config property `requestedSecretLifetime`. This helps reducing frequent Pod restarts ([#722]). +- Run a `containerdebug` process in the background of each Airflow container to collect debugging information ([#730]). ### Fixed @@ -19,6 +20,7 @@ All notable changes to this project will be documented in this file. [#717]: https://github.com/stackabletech/nifi-operator/pull/717 [#718]: https://github.com/stackabletech/nifi-operator/pull/718 [#722]: https://github.com/stackabletech/nifi-operator/pull/722 +[#730]: https://github.com/stackabletech/nifi-operator/pull/730 ## [24.11.0] - 2024-11-18 diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index ac80b72a..c7c4f06c 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -938,6 +938,13 @@ async fn build_node_rolegroup_statefulset( ..EnvVar::default() }); + // Needed for the `containerdebug` process to log it's tracing information to. + env_vars.push(EnvVar { + name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(), + value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")), + value_from: None, + }); + env_vars.push(zookeeper_env_var( "ZOOKEEPER_HOSTS", &nifi.spec.cluster_config.zookeeper_config_map_name, @@ -1084,6 +1091,7 @@ async fn build_node_rolegroup_statefulset( {COMMON_BASH_TRAP_FUNCTIONS} {remove_vector_shutdown_file_command} prepare_signal_handlers + containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop & bin/nifi.sh run & wait_for_termination $! {create_vector_shutdown_file_command} diff --git a/tests/templates/kuttl/smoke/31-assert.yaml b/tests/templates/kuttl/smoke/32-assert.yaml similarity index 100% rename from tests/templates/kuttl/smoke/31-assert.yaml rename to tests/templates/kuttl/smoke/32-assert.yaml diff --git a/tests/templates/kuttl/smoke/33-assert.yaml b/tests/templates/kuttl/smoke/33-assert.yaml new file mode 100644 index 00000000..b2a98140 --- /dev/null +++ b/tests/templates/kuttl/smoke/33-assert.yaml @@ -0,0 +1,7 @@ +--- +# 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 nifi test-nifi-node-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'