Skip to content

Commit c78408c

Browse files
authored
Merge branch 'main' into release-crates-for-25.7
2 parents aa5aca0 + 9b103e9 commit c78408c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ All notable changes to this project will be documented in this file.
3333
fieldPath: spec.nodeName
3434
```
3535

36+
- Add associated functions on `RoleGroupRef` to return the rolegroup headless and metrics service name ([#1069]).
37+
3638
### Changed
3739

3840
- Update `kube` to `1.1.0` ([#1049]).
@@ -53,6 +55,7 @@ All notable changes to this project will be documented in this file.
5355
[#1060]: https://github.com/stackabletech/operator-rs/pull/1060
5456
[#1064]: https://github.com/stackabletech/operator-rs/pull/1064
5557
[#1068]: https://github.com/stackabletech/operator-rs/pull/1068
58+
[#1069]: https://github.com/stackabletech/operator-rs/pull/1069
5659
[#1071]: https://github.com/stackabletech/operator-rs/pull/1071
5760

5861
## [0.93.2] - 2025-05-26

crates/stackable-operator/src/role_utils.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,27 @@ impl<K: Resource> RoleGroupRef<K> {
472472
pub fn object_name(&self) -> String {
473473
format!("{}-{}-{}", self.cluster.name, self.role, self.role_group)
474474
}
475+
476+
/// Returns the service name used by rolegroups for cluster internal communication only.
477+
///
478+
/// The internal use of of this service name is indicated by the `-headless` suffix.
479+
/// This service should not be used for communication to external services or clients
480+
/// and also should not be used to export metrics (like Prometheus). Metrics should be
481+
/// instead exposed via a dedicated service. Use [`Self::rolegroup_metrics_service_name`]
482+
/// instead.
483+
pub fn rolegroup_headless_service_name(&self) -> String {
484+
format!("{name}-headless", name = self.object_name())
485+
}
486+
487+
/// Returns the service name used by rolegroups to expose metrics (like Prometheus).
488+
///
489+
/// The use for metrics only is indicated by the `-metrics` suffix. This service
490+
/// should not be used for any internal communication or any other external
491+
/// communication. For internal communication, use [`Self::rolegroup_headless_service_name`]
492+
/// instead.
493+
pub fn rolegroup_metrics_service_name(&self) -> String {
494+
format!("{name}-metrics", name = self.object_name())
495+
}
475496
}
476497

477498
impl<K: Resource> Display for RoleGroupRef<K> {

0 commit comments

Comments
 (0)