Skip to content

feat: Support hot-reloading for security configuration files#130

Open
siegfriedweber wants to merge 19 commits intomainfrom
feat/security-config-hot-reloading
Open

feat: Support hot-reloading for security configuration files#130
siegfriedweber wants to merge 19 commits intomainfrom
feat/security-config-hot-reloading

Conversation

@siegfriedweber
Copy link
Copy Markdown
Member

@siegfriedweber siegfriedweber commented Mar 27, 2026

Description

Support hot-reloading for security configuration files

Settings managed by the operator are hot-reloaded when changed, i.e. without pod restarts.

Part of stackabletech/issues#837

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@siegfriedweber siegfriedweber added release-note Denotes a PR that will be considered when it comes time to generate release notes. scheduled-for/26.7.0 labels Mar 31, 2026
@siegfriedweber siegfriedweber marked this pull request as ready for review April 14, 2026 13:49
@siegfriedweber siegfriedweber moved this to Development: Waiting for Review in Stackable Engineering Apr 15, 2026
@siegfriedweber
Copy link
Copy Markdown
Member Author

Release notes

New platform features

OpenSearch

  • Settings managed by the operator are now hot-reloaded when changed, i.e. without pod restarts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was unused.

metadata:
name: opensearch-security-config
stringData:
name: custom-opensearch-security-config
Copy link
Copy Markdown
Member Author

@siegfriedweber siegfriedweber Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator creates now a ConfigMap named <cluster-name>-security-config, see the upgrade guide. Therefore, another name is used here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous version of this script applied the configuration settings and then waited for a pod restart, which could be triggered by a change in the security settings. The new version waits in a loop for configuration changes (checked via file hashes) and then applies them.

///
/// Returns `None` if the security plugin is disabled or all configuration files are
/// references.
pub fn build_maybe_security_config_map(&self) -> Option<ConfigMap> {
Copy link
Copy Markdown
Member Author

@siegfriedweber siegfriedweber Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security settings which are defined by value, are now written to a dedicated (role-wide) ConfigMap instead of the role group ConfigMaps. This security ConfigMap is then excluded from the restart controller.

data.insert(VECTOR_CONFIG_FILE.to_owned(), vector_config_file_content());
}

if let RoleGroupSecurityMode::Initializing { settings, .. }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to RoleBuilder::build_maybe_security_config_map

Comment on lines -1631 to -1634
#[case::security_mode_initializing(TestSecurityMode::Initializing)]
#[case::security_mode_managing(TestSecurityMode::Managing)]
#[case::security_mode_participating(TestSecurityMode::Participating)]
#[case::security_mode_disabled(TestSecurityMode::Disabled)]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security settings are not located anymore in the role group ConfigMap. Therefore, the security mode test cases were removed.

Comment on lines -212 to +216
ValidatedSecurity::Disabled,
ValidatedSecurity::ManagedByApi {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable security to trigger the creation of the security ConfigMap.

/// The restarter uses these annotations to skip restarting Pods when specific Secrets change.
/// Indices start at 0 and are assigned in iteration order, so **do not merge the result with
/// annotations from another call** — duplicate indices would overwrite each other.
pub fn restarter_ignore_secret_annotations(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is similar to restarter_ignore_configmap_annotations. It would also be possible to create a common helper function which accepts IntoIterator<Item = String> or something similar. But I prefer the duplicated code in this case.

pullPolicy: IfNotPresent
clusterConfig:
security:
managingRoleGroup: security-coord
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use an explicit managing role group because this is not tested elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. scheduled-for/26.7.0

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

1 participant