Skip to content

Listener: Use headless and metrics service #613

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 8 commits into
base: main
Choose a base branch
from
Open

Conversation

Maleware
Copy link
Member

@Maleware Maleware commented Jul 2, 2025

Description

This PR adopts hive according to https://github.com/stackabletech/decisions/issues/54#issue-3110829918

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.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

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

@Maleware Maleware self-assigned this Jul 2, 2025
@Maleware Maleware moved this to Development: In Progress in Stackable Engineering Jul 2, 2025
@Maleware Maleware changed the title updating according to decision Listener: Use headless and metrics service Jul 2, 2025
@Maleware Maleware moved this from Development: In Progress to Development: Waiting for Review in Stackable Engineering Jul 2, 2025
@Maleware
Copy link
Member Author

Maleware commented Jul 3, 2025

@maltesander maltesander self-requested a review July 3, 2025 15:31
@maltesander maltesander moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Jul 3, 2025
@@ -246,6 +246,43 @@ impl v1alpha1::HiveCluster {
format!("{name}-{role}", name = self.name_any(), role = hive_role)
}

/// Set of functions to define service names on rolegroup level.
Copy link
Member

Choose a reason for hiding this comment

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

Not really useful and belongs to this method only.

Suggested change
/// Set of functions to define service names on rolegroup level.

Copy link
Member Author

Choose a reason for hiding this comment

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

done 9f2a57f

selector: Some(
Labels::role_group_selector(hive, APP_NAME, &rolegroup.role, &rolegroup.role_group)
) -> Result<Vec<Service>> {
let services = vec![
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to a service.rs module and put the two services in its own methods?

Copy link
Member Author

Choose a reason for hiding this comment

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

done 9f2a57f

Comment on lines 250 to 284
/// Headless service for cluster internal purposes only.
// TODO: Move to operator-rs
pub fn rolegroup_headless_service_name(
&self,
rolegroup: &RoleGroupRef<v1alpha1::HiveCluster>,
) -> String {
format!("{name}-headless", name = rolegroup.object_name())
}

/// Headless metrics service exposes Prometheus endpoint only
// TODO: Move to operator-rs
pub fn rolegroup_headless_metrics_service_name(
&self,
rolegroup: &RoleGroupRef<v1alpha1::HiveCluster>,
) -> String {
format!("{name}-metrics", name = rolegroup.object_name())
}

pub fn metrics_ports(&self) -> Vec<ServicePort> {
vec![ServicePort {
name: Some(METRICS_PORT_NAME.to_string()),
port: METRICS_PORT.into(),
protocol: Some("TCP".to_string()),
..ServicePort::default()
}]
}

pub fn service_ports(&self) -> Vec<ServicePort> {
vec![ServicePort {
name: Some(HIVE_PORT_NAME.to_string()),
port: HIVE_PORT.into(),
protocol: Some("TCP".to_string()),
..ServicePort::default()
}]
}
Copy link
Member

Choose a reason for hiding this comment

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

This should not be implemented on the cluster (does not need self) and could go into a service.rs module.

Copy link
Member Author

Choose a reason for hiding this comment

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

done 9f2a57f

@Maleware Maleware requested a review from maltesander July 3, 2025 16:50
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