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

Merged
merged 9 commits into from
Jul 10, 2025
11 changes: 11 additions & 0 deletions crates/stackable-operator/src/role_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,17 @@ impl<K: Resource> RoleGroupRef<K> {
pub fn object_name(&self) -> String {
format!("{}-{}-{}", self.cluster.name, self.role, self.role_group)
}

/// Set of functions to define service names on rolegroup level.
/// Headless service for cluster internal purposes only.
pub fn rolegroup_headless_service_name(&self) -> String {
format!("{name}-headless", name = self.object_name())
}

/// Headless metrics service exposes Prometheus endpoint only
pub fn rolegroup_headless_metrics_service_name(&self) -> String {
format!("{name}-metrics", name = self.object_name())
}
}

impl<K: Resource> Display for RoleGroupRef<K> {
Expand Down