Skip to content

Commit 32b79a1

Browse files
committed
wip
1 parent aeedf54 commit 32b79a1

File tree

7 files changed

+1258
-0
lines changed

7 files changed

+1258
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use stackable_operator::{
2+
commons::affinity::{affinity_between_role_pods, StackableAffinityFragment},
3+
k8s_openapi::api::core::v1::PodAntiAffinity,
4+
};
5+
6+
use crate::connect::crd::CONNECT_ROLE_NAME;
7+
use crate::crd::constants::APP_NAME;
8+
9+
pub fn affinity(cluster_name: &str) -> StackableAffinityFragment {
10+
let affinity_between_role_pods =
11+
affinity_between_role_pods(APP_NAME, cluster_name, CONNECT_ROLE_NAME, 70);
12+
13+
StackableAffinityFragment {
14+
pod_affinity: None,
15+
pod_anti_affinity: Some(PodAntiAffinity {
16+
preferred_during_scheduling_ignored_during_execution: Some(vec![
17+
affinity_between_role_pods,
18+
]),
19+
required_during_scheduling_ignored_during_execution: None,
20+
}),
21+
node_affinity: None,
22+
node_selector: None,
23+
}
24+
}

0 commit comments

Comments
 (0)