mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 00:34:10 -04:00
Merge pull request #138488 from yliaog/master
DRA Extended Resource: promote to GA in 1.37
This commit is contained in:
commit
e0c1c5bd3d
32 changed files with 70 additions and 56 deletions
6
api/openapi-spec/swagger.json
generated
6
api/openapi-spec/swagger.json
generated
|
|
@ -16094,7 +16094,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
@ -17669,7 +17669,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
@ -18884,7 +18884,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
|
|||
|
|
@ -668,7 +668,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
|
|||
|
|
@ -668,7 +668,7 @@
|
|||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"extendedResourceName": {
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
"type": "string"
|
||||
},
|
||||
"selectors": {
|
||||
|
|
|
|||
|
|
@ -1145,6 +1145,8 @@ func TestDropDynamicResourceAllocation(t *testing.T) {
|
|||
t.Run(tc.description, func(t *testing.T) {
|
||||
if !tc.enabled {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.34"))
|
||||
} else if !tc.extendedEnabled {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
overrides := featuregatetesting.FeatureOverrides{
|
||||
features.DynamicResourceAllocation: tc.enabled,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
|
|
@ -2041,6 +2042,9 @@ func TestEnqueuePodExtendedResourceClaims(t *testing.T) {
|
|||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if !test.featureGateEnabled {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.featureGateEnabled)
|
||||
|
||||
tCtx := ktesting.Init(t)
|
||||
|
|
|
|||
|
|
@ -1307,6 +1307,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
|||
DRAExtendedResource: {
|
||||
{Version: version.MustParse("1.34"), Default: false, PreRelease: featuregate.Alpha},
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: featuregate.Beta},
|
||||
{Version: version.MustParse("1.37"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.37; remove in 1.40
|
||||
},
|
||||
|
||||
DRAListTypeAttributes: {
|
||||
|
|
|
|||
6
pkg/generated/openapi/zz_generated.openapi.go
generated
6
pkg/generated/openapi/zz_generated.openapi.go
generated
|
|
@ -47213,7 +47213,7 @@ func schema_k8sio_api_resource_v1_DeviceClassSpec(ref common.ReferenceCallback)
|
|||
},
|
||||
"extendedResourceName": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
|
|
@ -50083,7 +50083,7 @@ func schema_k8sio_api_resource_v1beta1_DeviceClassSpec(ref common.ReferenceCallb
|
|||
},
|
||||
"extendedResourceName": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
|
|
@ -52333,7 +52333,7 @@ func schema_k8sio_api_resource_v1beta2_DeviceClassSpec(ref common.ReferenceCallb
|
|||
},
|
||||
"extendedResourceName": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
Description: "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/client-go/tools/record"
|
||||
|
|
@ -2097,6 +2098,9 @@ func TestAdmitPodWithDRAResources(t *testing.T) {
|
|||
|
||||
for description, test := range testCases {
|
||||
t.Run(description, func(t *testing.T) {
|
||||
if !test.enableFeatureGate {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.enableFeatureGate)
|
||||
|
||||
pod := &v1.Pod{
|
||||
|
|
|
|||
|
|
@ -152,6 +152,9 @@ func TestRemoveMissingExtendedResources(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
if !test.enableDRAExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, utilversion.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.enableDRAExtendedResource)
|
||||
nodeInfo := schedulerframework.NewNodeInfo()
|
||||
nodeInfo.SetNode(test.node)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||
|
|
@ -93,7 +94,9 @@ func TestStrategyCreate(t *testing.T) {
|
|||
for name, tc := range testcases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
obj := tc.obj.DeepCopy()
|
||||
|
||||
if !tc.draExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, tc.draExtendedResource)
|
||||
|
||||
Strategy.PrepareForCreate(ctx, obj)
|
||||
|
|
@ -173,7 +176,9 @@ func TestStrategyUpdate(t *testing.T) {
|
|||
oldObj := tc.oldObj.DeepCopy()
|
||||
newObj := tc.newObj.DeepCopy()
|
||||
newObj.ResourceVersion = "4"
|
||||
|
||||
if !tc.draExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, tc.draExtendedResource)
|
||||
|
||||
Strategy.PrepareForUpdate(ctx, newObj, oldObj)
|
||||
|
|
|
|||
|
|
@ -465,6 +465,9 @@ func TestAddAllEventHandlers(t *testing.T) {
|
|||
if !tt.enableDRA {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.34"))
|
||||
} else {
|
||||
if !tt.enableDRAExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
// Making this depend on the emulated version avoids "cannot set feature gate DRADeviceTaintRules to false, feature is PreAlpha at emulated version 1.34".
|
||||
overrides[features.DRADeviceTaintRules] = tt.enableDRADeviceTaintRules
|
||||
overrides[features.GenericWorkload] = tt.enableGenericWorkload
|
||||
|
|
@ -647,6 +650,9 @@ func TestAdmissionCheck(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if !tt.enableDRAExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGatesDuringTest(t, utilfeature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{
|
||||
features.DRAExtendedResource: tt.enableDRAExtendedResource,
|
||||
features.DRANodeAllocatableResources: tt.enableDRANodeAllocatableResources,
|
||||
|
|
|
|||
|
|
@ -3530,7 +3530,9 @@ func testPlugin(tCtx ktesting.TContext) {
|
|||
EnableDRAConsumableCapacity: tc.enableDRAConsumableCapacity,
|
||||
EnableDRAWorkloadResourceClaims: tc.enableDRAWorkloadResourceClaims,
|
||||
}
|
||||
|
||||
if !tc.enableDRAExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, tc.enableDRAExtendedResource)
|
||||
if tc.disableDRAAdminAccess {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.35"))
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/google/go-cmp/cmp"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apiruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||
fwk "k8s.io/kube-scheduler/framework"
|
||||
|
|
@ -317,6 +318,9 @@ func testNodeResourcesBalancedAllocation(tCtx ktesting.TContext) {
|
|||
|
||||
for _, test := range tests {
|
||||
tCtx.SyncTest(test.name, func(tCtx ktesting.TContext) {
|
||||
if test.draObjects == nil {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.draObjects != nil)
|
||||
snapshot := cache.NewSnapshot(test.existingPods, test.nodes)
|
||||
fh, _ := runtime.NewFramework(tCtx, nil, nil, runtime.WithSnapshotSharedLister(snapshot))
|
||||
|
|
@ -438,7 +442,10 @@ func testBalancedAllocationSignPod(tCtx ktesting.TContext) {
|
|||
if !test.disableDRAExtendedResource {
|
||||
testDRAManager = newTestDRAManager(tCtx, deviceClassWithExtendResourceName)
|
||||
runOpts = append(runOpts, runtime.WithSharedDRAManager(testDRAManager))
|
||||
} else {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
|
||||
fh, _ := runtime.NewFramework(tCtx, nil, nil, runOpts...)
|
||||
defer func() {
|
||||
tCtx.Cancel("test has completed")
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
apiruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||
fwk "k8s.io/kube-scheduler/framework"
|
||||
|
|
@ -702,6 +703,9 @@ func testEnoughRequests(tCtx ktesting.TContext) {
|
|||
|
||||
for _, test := range enoughPodsTests {
|
||||
tCtx.SyncTest(test.name, func(tCtx ktesting.TContext) {
|
||||
if !test.draExtendedResourceEnabled {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.draExtendedResourceEnabled)
|
||||
node := v1.Node{Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 5, 20, 5), Allocatable: makeAllocatableResources(10, 20, 32, 5, 20, 5)}}
|
||||
test.nodeInfo.SetNode(&node)
|
||||
|
|
@ -1249,6 +1253,9 @@ func testFitScore(tCtx ktesting.TContext) {
|
|||
|
||||
for _, test := range tests {
|
||||
tCtx.SyncTest(test.name, func(tCtx ktesting.TContext) {
|
||||
if test.draObjects == nil {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, test.draObjects != nil)
|
||||
state := framework.NewCycleState()
|
||||
snapshot := cache.NewSnapshot(test.existingPods, test.nodes)
|
||||
|
|
@ -2190,6 +2197,9 @@ func testHaveAnyRequestedResourcesIncreased(tCtx ktesting.TContext) {
|
|||
for name, tc := range testCases {
|
||||
tCtx.SyncTest(name, func(tCtx ktesting.TContext) {
|
||||
var draManager *dynamicresources.DefaultDRAManager
|
||||
if !tc.draExtendedResourceEnabled {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, tc.draExtendedResourceEnabled)
|
||||
if tc.draExtendedResourceEnabled {
|
||||
draManager = newTestDRAManager(tCtx, deviceClassWithExtendResourceName)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
apiruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
|
|
@ -546,6 +547,9 @@ func testCalculateResourceAllocatableRequest(tCtx ktesting.TContext) {
|
|||
for name, tc := range tests {
|
||||
tCtx.SyncTest(name, func(tCtx ktesting.TContext) {
|
||||
// Setup environment, create required objects
|
||||
if !tc.enableDRAExtendedResource {
|
||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(tCtx, utilfeature.DefaultFeatureGate, version.MustParse("1.36"))
|
||||
}
|
||||
featuregatetesting.SetFeatureGateDuringTest(tCtx, utilfeature.DefaultFeatureGate, features.DRAExtendedResource, tc.enableDRAExtendedResource)
|
||||
|
||||
draManager := newTestDRAManager(tCtx, tc.draObjects...)
|
||||
|
|
|
|||
|
|
@ -789,7 +789,6 @@ message DeviceClassSpec {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -1996,7 +1996,6 @@ type DeviceClassSpec struct {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ var map_DeviceClassSpec = map[string]string{
|
|||
"": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.",
|
||||
"selectors": "Each selector must be satisfied by a device which is claimed via this class.",
|
||||
"config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
}
|
||||
|
||||
func (DeviceClassSpec) SwaggerDoc() map[string]string {
|
||||
|
|
|
|||
|
|
@ -797,7 +797,6 @@ message DeviceClassSpec {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -1997,7 +1997,6 @@ type DeviceClassSpec struct {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ var map_DeviceClassSpec = map[string]string{
|
|||
"": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.",
|
||||
"selectors": "Each selector must be satisfied by a device which is claimed via this class.",
|
||||
"config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
}
|
||||
|
||||
func (DeviceClassSpec) SwaggerDoc() map[string]string {
|
||||
|
|
|
|||
|
|
@ -792,7 +792,6 @@ message DeviceClassSpec {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -2140,7 +2140,6 @@ type DeviceClassSpec struct {
|
|||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ var map_DeviceClassSpec = map[string]string{
|
|||
"": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.",
|
||||
"selectors": "Each selector must be satisfied by a device which is claimed via this class.",
|
||||
"config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.",
|
||||
}
|
||||
|
||||
func (DeviceClassSpec) SwaggerDoc() map[string]string {
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct {
|
|||
// is picked to satisfy a pod's extended resource requests.
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct {
|
|||
// is picked to satisfy a pod's extended resource requests.
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct {
|
|||
// is picked to satisfy a pod's extended resource requests.
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
| DRADeviceBindingConditions | :ballot_box_with_check: 1.36+ | | 1.34–1.35 | 1.36– | | | DRAResourceClaimDeviceStatus<br>DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRADeviceBindingConditions%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRADeviceBindingConditions%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRADeviceTaintRules | | | 1.35 | 1.36– | | | DRADeviceTaints | [code](https://cs.k8s.io/?q=%5CbDRADeviceTaintRules%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRADeviceTaintRules%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRADeviceTaints | :ballot_box_with_check: 1.36+ | | 1.33–1.35 | 1.36– | | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRADeviceTaints%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRADeviceTaints%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRAExtendedResource | :ballot_box_with_check: 1.36+ | | 1.34–1.35 | 1.36– | | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRAExtendedResource%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRAExtendedResource%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRAExtendedResource | :ballot_box_with_check: 1.36+ | :closed_lock_with_key: 1.37+ | 1.34–1.35 | 1.36 | 1.37– | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRAExtendedResource%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRAExtendedResource%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRAListTypeAttributes | | | 1.36– | | | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRAListTypeAttributes%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRAListTypeAttributes%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRANodeAllocatableResources | | | 1.36– | | | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRANodeAllocatableResources%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRANodeAllocatableResources%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
| DRAPartitionableDevices | :ballot_box_with_check: 1.36+ | | 1.33–1.35 | 1.36– | | | DynamicResourceAllocation | [code](https://cs.k8s.io/?q=%5CbDRAPartitionableDevices%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/kubernetes) [KEPs](https://cs.k8s.io/?q=%5CbDRAPartitionableDevices%5Cb&i=nope&files=&excludeFiles=CHANGELOG&repos=kubernetes/enhancements) |
|
||||
|
|
|
|||
|
|
@ -513,6 +513,10 @@
|
|||
lockToDefault: false
|
||||
preRelease: Beta
|
||||
version: "1.36"
|
||||
- default: true
|
||||
lockToDefault: true
|
||||
preRelease: GA
|
||||
version: "1.37"
|
||||
- name: DRAListTypeAttributes
|
||||
versionedSpecs:
|
||||
- default: false
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ func run(tCtx ktesting.TContext, whatRE string) {
|
|||
runSubTest(tCtx, "PublishResourceSlices", func(tCtx ktesting.TContext) {
|
||||
testPublishResourceSlices(tCtx, true, features.DRADeviceTaints, features.DRAPartitionableDevices, features.DRADeviceBindingConditions)
|
||||
})
|
||||
runSubTest(tCtx, "ExplicitExtendedResource", func(tCtx ktesting.TContext) { testExtendedResource(tCtx, false, true) })
|
||||
runSubTest(tCtx, "ImplicitExtendedResource", func(tCtx ktesting.TContext) { testExtendedResource(tCtx, false, false) })
|
||||
runSubTest(tCtx, "ExplicitExtendedResource", func(tCtx ktesting.TContext) { testExtendedResource(tCtx, true, true) })
|
||||
runSubTest(tCtx, "ImplicitExtendedResource", func(tCtx ktesting.TContext) { testExtendedResource(tCtx, true, false) })
|
||||
runSubTest(tCtx, "ResourceClaimDeviceStatus", func(tCtx ktesting.TContext) { testResourceClaimDeviceStatus(tCtx, false) })
|
||||
runSubTest(tCtx, "DeviceBindingConditions", func(tCtx ktesting.TContext) { testDeviceBindingConditions(tCtx, false) })
|
||||
runSubTest(tCtx, "ResourceSliceController", func(tCtx ktesting.TContext) {
|
||||
|
|
|
|||
|
|
@ -464,16 +464,6 @@
|
|||
podTemplatePath: templates/pod-with-extended-resource.yaml
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
- name: fast
|
||||
featureGates:
|
||||
DRAExtendedResource: false
|
||||
labels: [integration-test, short]
|
||||
params:
|
||||
# This testcase runs through all code paths without
|
||||
# taking too long overall.
|
||||
nodesWithExtendedResource: 10
|
||||
nodesWithoutExtendedResource: 1
|
||||
measurePods: 10
|
||||
- name: fast_DRAExtendedResourceEnabled
|
||||
featureGates:
|
||||
DRAExtendedResource: true
|
||||
|
|
@ -484,13 +474,6 @@
|
|||
nodesWithExtendedResource: 10
|
||||
nodesWithoutExtendedResource: 1
|
||||
measurePods: 10
|
||||
- name: 500pods_500nodes
|
||||
featureGates:
|
||||
DRAExtendedResource: false
|
||||
params:
|
||||
nodesWithExtendedResource: 500
|
||||
nodesWithoutExtendedResource: 0
|
||||
measurePods: 500
|
||||
- name: 500pods_500nodes_DRAExtendedResourceEnabled
|
||||
featureGates:
|
||||
DRAExtendedResource: true
|
||||
|
|
@ -498,15 +481,6 @@
|
|||
nodesWithExtendedResource: 500
|
||||
nodesWithoutExtendedResource: 0
|
||||
measurePods: 500
|
||||
- name: 5000pods_5000nodes
|
||||
featureGates:
|
||||
DRAExtendedResource: false
|
||||
labels: [performance]
|
||||
threshold: 180
|
||||
params:
|
||||
nodesWithExtendedResource: 5000
|
||||
nodesWithoutExtendedResource: 0
|
||||
measurePods: 5000
|
||||
- name: 5000pods_5000nodes_DRAExtendedResourceEnabled
|
||||
featureGates:
|
||||
DRAExtendedResource: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue