-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
rust/operator-binary/src/crd/mod.rs
Outdated
@@ -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. |
There was a problem hiding this comment.
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.
/// Set of functions to define service names on rolegroup level. |
There was a problem hiding this comment.
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![ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 9f2a57f
rust/operator-binary/src/crd/mod.rs
Outdated
/// 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() | ||
}] | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 9f2a57f
Description
This PR adopts hive according to https://github.com/stackabletech/decisions/issues/54#issue-3110829918
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecation
label & add to the deprecation scheduletype/experimental
label & add to the experimental features tracker