From 47d89efdc38fc2c70d129bc82cc14635f049ce82 Mon Sep 17 00:00:00 2001 From: Kirby Chin Date: Fri, 27 Oct 2023 20:25:00 -0400 Subject: [PATCH] Add PodAntiAffinity for Semeru Cloud Compiler + update RCO (#514) * Add PodAffinity for semeru cloud compiler * Add PodAffinity for Semeru compiler * Add preferredMaxLoad variable to Semeru compiler * Indicate soft max for preferredMaxLoad * Update zz_generated.deepcopy.go * Remove Semeru spec variable * Remove topology-mode * Update semeru_compiler.go * Revert replicas CRD description * Update ibm-websphere-liberty.clusterserviceversion.yaml * Update RCO dependency * Remove ununsed packages using go mod tidy --- controllers/semeru_compiler.go | 17 +++++++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/controllers/semeru_compiler.go b/controllers/semeru_compiler.go index 2012fe31..18104cae 100644 --- a/controllers/semeru_compiler.go +++ b/controllers/semeru_compiler.go @@ -304,6 +304,23 @@ func (r *ReconcileWebSphereLiberty) reconcileSemeruDeployment(wlva *wlv1.WebSphe Annotations: wlutils.GetWLOLicenseAnnotations(), }, Spec: corev1.PodSpec{ + Affinity: &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + PreferredDuringSchedulingIgnoredDuringExecution: []corev1.WeightedPodAffinityTerm{ + { + Weight: 50, + PodAffinityTerm: corev1.PodAffinityTerm{ + TopologyKey: "topology.kubernetes.io/zone", + LabelSelector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app.kubernetes.io/name": getSemeruCompilerName(wlva), + }, + }, + }, + }, + }, + }, + }, Containers: []corev1.Container{ { Name: "compiler", diff --git a/go.mod b/go.mod index 3ce08b58..b5e1ea0e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/WASdev/websphere-liberty-operator go 1.21 require ( - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231024192226-922d2a5db383 + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231027224121-66e9415767a9 github.com/cert-manager/cert-manager v1.10.2 github.com/go-logr/logr v1.2.4 github.com/openshift/api v0.0.0-20230928134114-673ed0cfc7f1 diff --git a/go.sum b/go.sum index 23f5e985..69b838af 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231024192226-922d2a5db383 h1:X0UjPYAsuK+ByO9Iy18ZxPjOPnFYUWE+yBX5tM5606M= -github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231024192226-922d2a5db383/go.mod h1:mQO6jtL9OMEzAx+IyCTDyEUm9wN1vUeunw0aROcepBw= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231027224121-66e9415767a9 h1:5NILNbUpUUW0eLTUSiDbTe01a/tDCb3sRXwfSl6v460= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20231027224121-66e9415767a9/go.mod h1:Yhxg+reeWEw4OnPUsX3ZYogS3RbtmC0M20TzX/w4N0I= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=