mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
feature gate local storage allocatable eviction
This commit is contained in:
parent
175a6dee47
commit
8659676408
@ -1431,6 +1431,7 @@ func TestAllocatableMemoryPressure(t *testing.T) {
|
|||||||
|
|
||||||
// TestAllocatableNodeFsPressure
|
// TestAllocatableNodeFsPressure
|
||||||
func TestAllocatableNodeFsPressure(t *testing.T) {
|
func TestAllocatableNodeFsPressure(t *testing.T) {
|
||||||
|
utilfeature.DefaultFeatureGate.Set("LocalStorageCapacityIsolation=True")
|
||||||
podMaker := makePodWithDiskStats
|
podMaker := makePodWithDiskStats
|
||||||
summaryStatsMaker := makeDiskStats
|
summaryStatsMaker := makeDiskStats
|
||||||
|
|
||||||
@ -1583,6 +1584,7 @@ func TestAllocatableNodeFsPressure(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeReclaimForAllocatableFuncs(t *testing.T) {
|
func TestNodeReclaimForAllocatableFuncs(t *testing.T) {
|
||||||
|
utilfeature.DefaultFeatureGate.Set("LocalStorageCapacityIsolation=True")
|
||||||
podMaker := makePodWithDiskStats
|
podMaker := makePodWithDiskStats
|
||||||
summaryStatsMaker := makeDiskStats
|
summaryStatsMaker := makeDiskStats
|
||||||
podsToMake := []podToMake{
|
podsToMake := []podToMake{
|
||||||
|
@ -27,7 +27,9 @@ import (
|
|||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
v1qos "k8s.io/kubernetes/pkg/api/v1/helper/qos"
|
v1qos "k8s.io/kubernetes/pkg/api/v1/helper/qos"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
statsapi "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
|
statsapi "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/cm"
|
"k8s.io/kubernetes/pkg/kubelet/cm"
|
||||||
evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api"
|
evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api"
|
||||||
@ -790,6 +792,7 @@ func makeSignalObservations(summaryProvider stats.SummaryProvider, capacityProvi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
|
||||||
ephemeralStorageCapacity, ephemeralStorageAllocatable, exist := getResourceAllocatable(nodeCapacity, allocatableReservation, v1.ResourceEphemeralStorage)
|
ephemeralStorageCapacity, ephemeralStorageAllocatable, exist := getResourceAllocatable(nodeCapacity, allocatableReservation, v1.ResourceEphemeralStorage)
|
||||||
if exist {
|
if exist {
|
||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
@ -817,6 +820,7 @@ func makeSignalObservations(summaryProvider stats.SummaryProvider, capacityProvi
|
|||||||
capacity: ephemeralStorageCapacity,
|
capacity: ephemeralStorageCapacity,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result, statsFunc, nil
|
return result, statsFunc, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user