Skip to content

Commit 4e82b52

Browse files
authored
Add PodAntiAffinity based on host/node to Semeru compiler (#566)
* Add affinity based on host to semeru compiler Signed-off-by: Leo Christy Jesuraj <[email protected]> * Use the instance name in the affinity for Semeru Signed-off-by: Leo Christy Jesuraj <[email protected]> * Use the instance label on semeru affinity Signed-off-by: Leo Christy Jesuraj <[email protected]> --------- Signed-off-by: Leo Christy Jesuraj <[email protected]>
1 parent c95e030 commit 4e82b52

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

controllers/semeru_compiler.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,18 @@ func (r *ReconcileWebSphereLiberty) reconcileSemeruDeployment(wlva *wlv1.WebSphe
313313
TopologyKey: "topology.kubernetes.io/zone",
314314
LabelSelector: &metav1.LabelSelector{
315315
MatchLabels: map[string]string{
316-
"app.kubernetes.io/name": getSemeruCompilerName(wlva),
316+
"app.kubernetes.io/instance": getSemeruCompilerNameWithGeneration(wlva),
317+
},
318+
},
319+
},
320+
},
321+
{
322+
Weight: 50,
323+
PodAffinityTerm: corev1.PodAffinityTerm{
324+
TopologyKey: "kubernetes.io/hostname",
325+
LabelSelector: &metav1.LabelSelector{
326+
MatchLabels: map[string]string{
327+
"app.kubernetes.io/instance": getSemeruCompilerNameWithGeneration(wlva),
317328
},
318329
},
319330
},

0 commit comments

Comments
 (0)