Skip to content

Commit 91d7882

Browse files
committed
DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key differences: - refocused on structured parameters and allocating devices - support for constraints across devices - support for allocating "all" or a fixed amount of similar devices in a single request - no class for ResourceClaims, instead individual device requests are associated with a mandatory DeviceClass For the sake of simplicity, optional basic types (ints, strings) where the null value is the default are represented as values in the API types. This makes Go code simpler because it doesn't have to check for nil (consumers) and values can be set directly (producers). The effect is that in protobuf, these fields always get encoded because `opt` only has an effect for pointers. The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new "request" field. This is considered acceptable because the entire `claims` field in the pod spec is still alpha. The implementation is complete enough to bring up the apiserver. Adapting other components follows.
1 parent bcececa commit 91d7882

File tree

306 files changed

+15104
-25090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+15104
-25090
lines changed

api/api-rules/violation_exceptions.list

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,CephFS
5252
API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,StorageOS
5353
API rule violation: names_match,k8s.io/api/networking/v1alpha1,ServiceCIDRSpec,CIDRs
5454
API rule violation: names_match,k8s.io/api/networking/v1beta1,ServiceCIDRSpec,CIDRs
55-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,BoolValue
56-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,IntSliceValue
57-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,IntValue
58-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,QuantityValue
59-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,StringSliceValue
60-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,StringValue
61-
API rule violation: names_match,k8s.io/api/resource/v1alpha3,NamedResourcesAttributeValue,VersionValue
55+
API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,BoolValue
56+
API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,IntValue
57+
API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,StringValue
58+
API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,VersionValue
6259
API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Ref
6360
API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Schema
6461
API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XEmbeddedResource

api/discovery/aggregated_v2.json

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,26 @@
18911891
{
18921892
"freshness": "Current",
18931893
"resources": [
1894+
{
1895+
"resource": "deviceclasses",
1896+
"responseKind": {
1897+
"group": "",
1898+
"kind": "DeviceClass",
1899+
"version": ""
1900+
},
1901+
"scope": "Cluster",
1902+
"singularResource": "deviceclass",
1903+
"verbs": [
1904+
"create",
1905+
"delete",
1906+
"deletecollection",
1907+
"get",
1908+
"list",
1909+
"patch",
1910+
"update",
1911+
"watch"
1912+
]
1913+
},
18941914
{
18951915
"resource": "podschedulingcontexts",
18961916
"responseKind": {
@@ -1926,26 +1946,6 @@
19261946
"watch"
19271947
]
19281948
},
1929-
{
1930-
"resource": "resourceclaimparameters",
1931-
"responseKind": {
1932-
"group": "",
1933-
"kind": "ResourceClaimParameters",
1934-
"version": ""
1935-
},
1936-
"scope": "Namespaced",
1937-
"singularResource": "resourceclaimparameters",
1938-
"verbs": [
1939-
"create",
1940-
"delete",
1941-
"deletecollection",
1942-
"get",
1943-
"list",
1944-
"patch",
1945-
"update",
1946-
"watch"
1947-
]
1948-
},
19491949
{
19501950
"resource": "resourceclaims",
19511951
"responseKind": {
@@ -2001,46 +2001,6 @@
20012001
"watch"
20022002
]
20032003
},
2004-
{
2005-
"resource": "resourceclasses",
2006-
"responseKind": {
2007-
"group": "",
2008-
"kind": "ResourceClass",
2009-
"version": ""
2010-
},
2011-
"scope": "Cluster",
2012-
"singularResource": "resourceclass",
2013-
"verbs": [
2014-
"create",
2015-
"delete",
2016-
"deletecollection",
2017-
"get",
2018-
"list",
2019-
"patch",
2020-
"update",
2021-
"watch"
2022-
]
2023-
},
2024-
{
2025-
"resource": "resourceclassparameters",
2026-
"responseKind": {
2027-
"group": "",
2028-
"kind": "ResourceClassParameters",
2029-
"version": ""
2030-
},
2031-
"scope": "Namespaced",
2032-
"singularResource": "resourceclassparameters",
2033-
"verbs": [
2034-
"create",
2035-
"delete",
2036-
"deletecollection",
2037-
"get",
2038-
"list",
2039-
"patch",
2040-
"update",
2041-
"watch"
2042-
]
2043-
},
20442004
{
20452005
"resource": "resourceslices",
20462006
"responseKind": {

api/discovery/aggregated_v2beta1.json

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,26 @@
18911891
{
18921892
"freshness": "Current",
18931893
"resources": [
1894+
{
1895+
"resource": "deviceclasses",
1896+
"responseKind": {
1897+
"group": "",
1898+
"kind": "DeviceClass",
1899+
"version": ""
1900+
},
1901+
"scope": "Cluster",
1902+
"singularResource": "deviceclass",
1903+
"verbs": [
1904+
"create",
1905+
"delete",
1906+
"deletecollection",
1907+
"get",
1908+
"list",
1909+
"patch",
1910+
"update",
1911+
"watch"
1912+
]
1913+
},
18941914
{
18951915
"resource": "podschedulingcontexts",
18961916
"responseKind": {
@@ -1926,26 +1946,6 @@
19261946
"watch"
19271947
]
19281948
},
1929-
{
1930-
"resource": "resourceclaimparameters",
1931-
"responseKind": {
1932-
"group": "",
1933-
"kind": "ResourceClaimParameters",
1934-
"version": ""
1935-
},
1936-
"scope": "Namespaced",
1937-
"singularResource": "resourceclaimparameters",
1938-
"verbs": [
1939-
"create",
1940-
"delete",
1941-
"deletecollection",
1942-
"get",
1943-
"list",
1944-
"patch",
1945-
"update",
1946-
"watch"
1947-
]
1948-
},
19491949
{
19501950
"resource": "resourceclaims",
19511951
"responseKind": {
@@ -2001,46 +2001,6 @@
20012001
"watch"
20022002
]
20032003
},
2004-
{
2005-
"resource": "resourceclasses",
2006-
"responseKind": {
2007-
"group": "",
2008-
"kind": "ResourceClass",
2009-
"version": ""
2010-
},
2011-
"scope": "Cluster",
2012-
"singularResource": "resourceclass",
2013-
"verbs": [
2014-
"create",
2015-
"delete",
2016-
"deletecollection",
2017-
"get",
2018-
"list",
2019-
"patch",
2020-
"update",
2021-
"watch"
2022-
]
2023-
},
2024-
{
2025-
"resource": "resourceclassparameters",
2026-
"responseKind": {
2027-
"group": "",
2028-
"kind": "ResourceClassParameters",
2029-
"version": ""
2030-
},
2031-
"scope": "Namespaced",
2032-
"singularResource": "resourceclassparameters",
2033-
"verbs": [
2034-
"create",
2035-
"delete",
2036-
"deletecollection",
2037-
"get",
2038-
"list",
2039-
"patch",
2040-
"update",
2041-
"watch"
2042-
]
2043-
},
20442004
{
20452005
"resource": "resourceslices",
20462006
"responseKind": {

api/discovery/apis__resource.k8s.io__v1alpha3.json

Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
"groupVersion": "resource.k8s.io/v1alpha3",
44
"kind": "APIResourceList",
55
"resources": [
6+
{
7+
"kind": "DeviceClass",
8+
"name": "deviceclasses",
9+
"namespaced": false,
10+
"singularName": "deviceclass",
11+
"storageVersionHash": "12soGlw2WzE=",
12+
"verbs": [
13+
"create",
14+
"delete",
15+
"deletecollection",
16+
"get",
17+
"list",
18+
"patch",
19+
"update",
20+
"watch"
21+
]
22+
},
623
{
724
"kind": "PodSchedulingContext",
825
"name": "podschedulingcontexts",
@@ -31,23 +48,6 @@
3148
"update"
3249
]
3350
},
34-
{
35-
"kind": "ResourceClaimParameters",
36-
"name": "resourceclaimparameters",
37-
"namespaced": true,
38-
"singularName": "resourceclaimparameters",
39-
"storageVersionHash": "42WVd9cucrU=",
40-
"verbs": [
41-
"create",
42-
"delete",
43-
"deletecollection",
44-
"get",
45-
"list",
46-
"patch",
47-
"update",
48-
"watch"
49-
]
50-
},
5151
{
5252
"kind": "ResourceClaim",
5353
"name": "resourceclaims",
@@ -93,40 +93,6 @@
9393
"watch"
9494
]
9595
},
96-
{
97-
"kind": "ResourceClass",
98-
"name": "resourceclasses",
99-
"namespaced": false,
100-
"singularName": "resourceclass",
101-
"storageVersionHash": "gv35DluSP3c=",
102-
"verbs": [
103-
"create",
104-
"delete",
105-
"deletecollection",
106-
"get",
107-
"list",
108-
"patch",
109-
"update",
110-
"watch"
111-
]
112-
},
113-
{
114-
"kind": "ResourceClassParameters",
115-
"name": "resourceclassparameters",
116-
"namespaced": true,
117-
"singularName": "resourceclassparameters",
118-
"storageVersionHash": "369PrU9Yi/E=",
119-
"verbs": [
120-
"create",
121-
"delete",
122-
"deletecollection",
123-
"get",
124-
"list",
125-
"patch",
126-
"update",
127-
"watch"
128-
]
129-
},
13096
{
13197
"kind": "ResourceSlice",
13298
"name": "resourceslices",

0 commit comments

Comments
 (0)