Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased]

### Fixed

- Fix container not starting because Superset was starting too slow and was killed because a failing liveness probe.
We now add a proper startup probe, which allows Superset to take longer to start up ([#654]).

[#654]: https://github.com/stackabletech/superset-operator/pull/654

## [25.7.0] - 2025-07-23

## [25.7.0-rc1] - 2025-07-18
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Cargo.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/superset-operator"

[workspace.dependencies]
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.96.0" }

anyhow = "1.0"
built = { version = "0.8", features = ["chrono", "git2"] }
Expand Down
14 changes: 7 additions & 7 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use clap::Parser;
use futures::{StreamExt, pin_mut};
use stackable_operator::{
YamlSchema,
cli::{Command, ProductOperatorRun},
cli::{Command, CommonOptions, ProductOperatorRun},
crd::authentication::core,
k8s_openapi::api::{
apps::v1::StatefulSet,
Expand Down Expand Up @@ -77,11 +77,14 @@ async fn main() -> anyhow::Result<()> {
.print_yaml_schema(built_info::PKG_VERSION, SerializeOptions::default())?;
}
Command::Run(ProductOperatorRun {
common:
CommonOptions {
telemetry,
cluster_info,
},
operator_environment: _,
product_config,
watch_namespace,
operator_environment: _,
telemetry,
cluster_info,
}) => {
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
// - The console log level was set by `SUPERSET_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
Expand Down
51 changes: 34 additions & 17 deletions rust/operator-binary/src/superset_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use stackable_operator::{
pod::{
PodBuilder,
container::ContainerBuilder,
probe::ProbeBuilder,
resources::ResourceRequirementsBuilder,
security::PodSecurityContextBuilder,
volume::{
Expand All @@ -40,9 +41,9 @@ use stackable_operator::{
DeepMerge,
api::{
apps::v1::{StatefulSet, StatefulSetSpec},
core::v1::{ConfigMap, EnvVar, HTTPGetAction, Probe},
core::v1::{ConfigMap, EnvVar},
},
apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString},
apimachinery::pkg::apis::meta::v1::LabelSelector,
},
kube::{
Resource, ResourceExt,
Expand Down Expand Up @@ -797,21 +798,7 @@ fn build_server_rolegroup_statefulset(
create_vector_shutdown_file_command(STACKABLE_LOG_DIR),
}])
.resources(merged_config.resources.clone().into());
let probe = Probe {
http_get: Some(HTTPGetAction {
port: IntOrString::Int(APP_PORT.into()),
path: Some("/health".to_string()),
..HTTPGetAction::default()
}),
initial_delay_seconds: Some(15),
period_seconds: Some(15),
timeout_seconds: Some(1),
failure_threshold: Some(3),
success_threshold: Some(1),
..Probe::default()
};
superset_cb.readiness_probe(probe.clone());
superset_cb.liveness_probe(probe);
add_superset_container_probes(&mut superset_cb);

// listener endpoints will use persistent volumes
// so that load balancers can hard-code the target addresses and
Expand Down Expand Up @@ -943,6 +930,36 @@ fn build_server_rolegroup_statefulset(
})
}

fn add_superset_container_probes(superset_cb: &mut ContainerBuilder) {
let common =
ProbeBuilder::http_get_port_scheme_path(APP_PORT, None, Some("/health".to_owned()))
.with_period(Duration::from_secs(5));

superset_cb.startup_probe(
common
.clone()
.with_failure_threshold_duration(Duration::from_minutes_unchecked(10))
.expect("const period is non-zero")
.build()
.expect("const duration does not overflow"),
);

// Remove it from the Service immediately
superset_cb.readiness_probe(
common
.clone()
.build()
.expect("const duration does not overflow"),
);
// But only restart it after 3 failures
superset_cb.liveness_probe(
common
.with_failure_threshold(3)
.build()
.expect("const duration does not overflow"),
);
}

fn add_authentication_volumes_and_volume_mounts(
auth_config: &SupersetClientAuthenticationDetailsResolved,
cb: &mut ContainerBuilder,
Expand Down
Loading