mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Respond to sig-node feedback
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
This commit is contained in:
parent
0c2357710a
commit
ac174f518c
@ -696,7 +696,7 @@ const (
|
|||||||
// owner: @jsturtevant
|
// owner: @jsturtevant
|
||||||
// kep: https://kep.k8s.io/4888
|
// kep: https://kep.k8s.io/4888
|
||||||
//
|
//
|
||||||
// Enables the Windows GMSA feature.
|
// Add CPU and Memory Affinity support to Windows nodes with CPUManager, MemoryManager and Topology manager
|
||||||
WindowsCPUAndMemoryAffinity featuregate.Feature = "WindowsCPUAndMemoryAffinity"
|
WindowsCPUAndMemoryAffinity featuregate.Feature = "WindowsCPUAndMemoryAffinity"
|
||||||
|
|
||||||
// owner: @marosset
|
// owner: @marosset
|
||||||
|
@ -19,9 +19,6 @@ package cpumanager
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
|
||||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
|
||||||
"k8s.io/kubernetes/pkg/features"
|
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -30,6 +27,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
|
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
|
|
||||||
cadvisorapi "github.com/google/cadvisor/info/v1"
|
cadvisorapi "github.com/google/cadvisor/info/v1"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
|
@ -29,7 +29,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (m *manager) updateContainerCPUSet(ctx context.Context, containerID string, cpus cpuset.CPUSet) error {
|
func (m *manager) updateContainerCPUSet(ctx context.Context, containerID string, cpus cpuset.CPUSet) error {
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.WindowsCPUAndMemoryAffinity) {
|
if !utilfeature.DefaultFeatureGate.Enabled(kubefeatures.WindowsCPUAndMemoryAffinity) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
affinities := winstats.CpusToGroupAffinity(cpus.List())
|
affinities := winstats.CpusToGroupAffinity(cpus.List())
|
||||||
var cpuGroupAffinities []*runtimeapi.WindowsCpuGroupAffinity
|
var cpuGroupAffinities []*runtimeapi.WindowsCpuGroupAffinity
|
||||||
for _, affinity := range affinities {
|
for _, affinity := range affinities {
|
||||||
@ -43,7 +46,4 @@ func (m *manager) updateContainerCPUSet(ctx context.Context, containerID string,
|
|||||||
AffinityCpus: cpuGroupAffinities,
|
AffinityCpus: cpuGroupAffinities,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@ limitations under the License.
|
|||||||
package winstats
|
package winstats
|
||||||
|
|
||||||
import (
|
import (
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
|
||||||
kubefeatures "k8s.io/kubernetes/pkg/features"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -31,6 +29,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
|
kubefeatures "k8s.io/kubernetes/pkg/features"
|
||||||
|
|
||||||
cadvisorapi "github.com/google/cadvisor/info/v1"
|
cadvisorapi "github.com/google/cadvisor/info/v1"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
|
Loading…
Reference in New Issue
Block a user