Skip to content

feat(stackable-operator): Add headless/metrics service name functions to RoleGroupRef #1069

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Maleware
Copy link
Member

@Maleware Maleware commented Jul 1, 2025

Description

This adds standardised functions to obey https://github.com/stackabletech/decisions/issues/54 consistently across SDP

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

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible

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

@Techassi Techassi self-requested a review July 3, 2025 14:05
Comment on lines +476 to +477
/// Set of functions to define service names on rolegroup level.
/// Headless service for cluster internal purposes only.
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Reword the doc comments.

Suggested change
/// Set of functions to define service names on rolegroup level.
/// Headless service for cluster internal purposes only.
/// Returns the service name used by rolegroups for cluster internal communication only.
///
/// The internal use of of this service name is indicated by the `-headless` suffix.
/// This service should not be used for communication to external services or clients
/// and also should not be used to export metrics (like Prometheus). Metrics should be
/// instead exposed via a dedicated service. Use [`Self::rolegroup_metrics_service_name`]
/// instead.

format!("{name}-headless", name = self.object_name())
}

/// Headless metrics service exposes Prometheus endpoint only
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Reword the doc comment.

Suggested change
/// Headless metrics service exposes Prometheus endpoint only
/// Returns the service name used by rolegroups to expose metrics (like Prometheus).
///
/// The use for metrics only is indicated by the `-metrics` suffix. This service
/// should not be used for any internal communication or any other external
/// communication. For internal communication, use [`Self::rolegroup_headless_service_name`]
/// instead.

}

/// Headless metrics service exposes Prometheus endpoint only
pub fn rolegroup_headless_metrics_service_name(&self) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

note: I feel like we should rename that function to rolegroup_metrics_service_name instead.

Suggested change
pub fn rolegroup_headless_metrics_service_name(&self) -> String {
pub fn rolegroup_metrics_service_name(&self) -> String {

@Techassi Techassi moved this to Development: In Review in Stackable Engineering Jul 4, 2025
@Techassi Techassi changed the title Add metrics and headless service name functions to RoleGroupRef feat(stackable-operator): Add rolegroup_{headless,metrics}_service_name functions to RoleGroupRef Jul 4, 2025
@Techassi Techassi changed the title feat(stackable-operator): Add rolegroup_{headless,metrics}_service_name functions to RoleGroupRef feat(stackable-operator): Add headless/metrics service name functions to RoleGroupRef Jul 4, 2025
Copy link
Member

@Techassi Techassi left a comment

Choose a reason for hiding this comment

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

Also, please add a changelog entry for these new functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Development: In Review
Development

Successfully merging this pull request may close these issues.

2 participants