-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubevirt, core): inject-placement-anynode (#595)
By default, the virtual-operator adds a nodePlacement with the RequireControlPlanePreferNonWorker. But we set up the placement ourselves, so we replace the policy with AnyNode. --------- Signed-off-by: yaroslavborbat <[email protected]>
- Loading branch information
1 parent
fead0c5
commit 2e97ef5
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
images/virt-artifact/patches/028-inject-placement-anynode.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/pkg/virt-operator/resource/apply/apps.go b/pkg/virt-operator/resource/apply/apps.go | ||
index 86a7e9cb5d..8554de9a05 100644 | ||
--- a/pkg/virt-operator/resource/apply/apps.go | ||
+++ b/pkg/virt-operator/resource/apply/apps.go | ||
@@ -51,7 +51,7 @@ func (r *Reconciler) syncDeployment(origDeployment *appsv1.Deployment) (*appsv1. | ||
|
||
injectOperatorMetadata(kv, &deployment.ObjectMeta, imageTag, imageRegistry, id, true) | ||
injectOperatorMetadata(kv, &deployment.Spec.Template.ObjectMeta, imageTag, imageRegistry, id, false) | ||
- InjectPlacementMetadata(kv.Spec.Infra, &deployment.Spec.Template.Spec, RequireControlPlanePreferNonWorker) | ||
+ InjectPlacementMetadata(kv.Spec.Infra, &deployment.Spec.Template.Spec, AnyNode) | ||
|
||
if kv.Spec.Infra != nil && kv.Spec.Infra.Replicas != nil { | ||
replicas := int32(*kv.Spec.Infra.Replicas) | ||
diff --git a/pkg/virt-operator/strategy_job.go b/pkg/virt-operator/strategy_job.go | ||
index df94c43bb1..b7ca869207 100644 | ||
--- a/pkg/virt-operator/strategy_job.go | ||
+++ b/pkg/virt-operator/strategy_job.go | ||
@@ -111,7 +111,7 @@ func (c *KubeVirtController) generateInstallStrategyJob(infraPlacement *v1.Compo | ||
}, | ||
} | ||
|
||
- apply.InjectPlacementMetadata(infraPlacement, &job.Spec.Template.Spec, apply.RequireControlPlanePreferNonWorker) | ||
+ apply.InjectPlacementMetadata(infraPlacement, &job.Spec.Template.Spec, apply.AnyNode) | ||
env := job.Spec.Template.Spec.Containers[0].Env | ||
extraEnv := util.NewEnvVarMap(config.GetExtraEnv()) | ||
job.Spec.Template.Spec.Containers[0].Env = append(env, *extraEnv...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters