Skip to content

Commit 2481164

Browse files
authored
Merge pull request #471 from ingvagabund/relieve-and-migrate-enabled-pvc-and-local-storage-pods-to-be-evicted
CNTRLPLANE-260: devKubeVirtRelieveAndMigrate: enable EvictPodsWithPVC and EvictPodsWithLocalStorage by default
2 parents 536068c + 0877e65 commit 2481164

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ Migration strategies may involve VM live migration, state transitions between st
163163

164164
This profile enables the [`LowNodeUtilization`](https://github.com/kubernetes-sigs/descheduler/#lownodeutilization) strategy
165165
with `EvictionsInBackground` alpha feature enabled.
166-
In the future, more configuration may be made available through the operator based on user feedback.
166+
At the same time, allow the eviction of pods with PVC or local storage (both disabled by default),
167+
as they are commonly encountered during VM eviction and migration.
168+
Equivalent to enabling both `EvictPodsWithPVC` and `EvictPodsWithLocalStorage` profiles in parallel.
169+
In the future, additional configurations may be introduced through the operator based on user feedback.
167170

168171
The profile exposes the following customization:
169172
- `devLowNodeUtilizationThresholds`: Sets experimental thresholds for the LowNodeUtilization strategy.

pkg/operator/target_config_reconciler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ func lifecycleAndUtilizationProfile(profileCustomizations *deschedulerv1.Profile
730730
return profile, nil
731731
}
732732

733-
func relieveAndMigrateProfile(profileCustomizations *deschedulerv1.ProfileCustomizations, includedNamespaces, excludedNamespaces, protectedNamespaces []string, ignorePVCPods, evictLocalStoragePods bool) (*v1alpha2.DeschedulerProfile, error) {
733+
func relieveAndMigrateProfile(profileCustomizations *deschedulerv1.ProfileCustomizations, includedNamespaces, excludedNamespaces, protectedNamespaces []string) (*v1alpha2.DeschedulerProfile, error) {
734734
profile := &v1alpha2.DeschedulerProfile{
735735
Name: string(deschedulerv1.RelieveAndMigrate),
736736
PluginConfigs: []v1alpha2.PluginConfig{
@@ -747,8 +747,8 @@ func relieveAndMigrateProfile(profileCustomizations *deschedulerv1.ProfileCustom
747747
Name: defaultevictor.PluginName,
748748
Args: runtime.RawExtension{
749749
Object: &defaultevictor.DefaultEvictorArgs{
750-
IgnorePvcPods: ignorePVCPods,
751-
EvictLocalStoragePods: evictLocalStoragePods,
750+
IgnorePvcPods: false, // evict pvc pods by default
751+
EvictLocalStoragePods: true, // evict pods with local storage by default
752752
},
753753
},
754754
},
@@ -1023,7 +1023,7 @@ func (c *TargetConfigReconciler) manageConfigMap(descheduler *deschedulerv1.Kube
10231023
case deschedulerv1.CompactAndScale:
10241024
profile, err = compactAndScaleProfile(descheduler.Spec.ProfileCustomizations, includedNamespaces, excludedNamespaces, ignorePVCPods, evictLocalStoragePods)
10251025
case deschedulerv1.RelieveAndMigrate:
1026-
profile, err = relieveAndMigrateProfile(descheduler.Spec.ProfileCustomizations, includedNamespaces, excludedNamespaces, c.protectedNamespaces, ignorePVCPods, evictLocalStoragePods)
1026+
profile, err = relieveAndMigrateProfile(descheduler.Spec.ProfileCustomizations, includedNamespaces, excludedNamespaces, c.protectedNamespaces)
10271027
default:
10281028
err = fmt.Errorf("Profile %q not recognized", profileName)
10291029
}

pkg/operator/testdata/assets/relieveAndMigrateHighConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ profiles:
2020
pods: 40
2121
name: LowNodeUtilization
2222
- args:
23-
ignorePvcPods: true
23+
evictLocalStoragePods: true
2424
name: DefaultEvictor
2525
plugins:
2626
balance:

pkg/operator/testdata/assets/relieveAndMigrateIncludedNamespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ profiles:
2020
pods: 20
2121
name: LowNodeUtilization
2222
- args:
23-
ignorePvcPods: true
23+
evictLocalStoragePods: true
2424
name: DefaultEvictor
2525
plugins:
2626
balance:

pkg/operator/testdata/assets/relieveAndMigrateLowConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ profiles:
2020
pods: 10
2121
name: LowNodeUtilization
2222
- args:
23-
ignorePvcPods: true
23+
evictLocalStoragePods: true
2424
name: DefaultEvictor
2525
plugins:
2626
balance:

pkg/operator/testdata/assets/relieveAndMigrateMediumConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ profiles:
2020
pods: 20
2121
name: LowNodeUtilization
2222
- args:
23-
ignorePvcPods: true
23+
evictLocalStoragePods: true
2424
name: DefaultEvictor
2525
plugins:
2626
balance:

0 commit comments

Comments
 (0)