File tree Expand file tree Collapse file tree 9 files changed +129
-119
lines changed Expand file tree Collapse file tree 9 files changed +129
-119
lines changed Original file line number Diff line number Diff line change 1
1
# A Pod with one secondary SR-IOV VF interface.
2
2
#
3
- apiVersion : v1
3
+ apiVersion : resource.k8s.io/v1alpha2
4
4
kind : Pod
5
5
metadata :
6
6
name : my-pod
13
13
requests :
14
14
cpu : 10m
15
15
memory : 10Mi
16
- deviceClaims :
17
- devices :
18
- - name : netdev0 # not used, but required
19
- class : example.com-sriov-vf
16
+ resourceClaims :
17
+ - name : netdev0
18
+ source :
19
+ forClass :
20
+ className : example.com-sriov-vf
Original file line number Diff line number Diff line change 1
1
# A Pod with two secondary SR-IOV VF interfaces, and one
2
2
# secondary SR-IOV PF interface.
3
3
#
4
- apiVersion : v1
4
+ apiVersion : resource.k8s.io/v1alpha1
5
5
kind : Pod
6
6
metadata :
7
7
name : my-pod
@@ -15,10 +15,15 @@ spec:
15
15
cpu : 10m
16
16
memory : 10Mi
17
17
deviceClaims :
18
- devices :
19
- - name : netdev0 # not used, but required
20
- class : example.com-sriov-vf
21
- - name : netdev1 # not used, but required
22
- class : example.com-sriov-vf
23
- - name : netdev2 # not used, but required
24
- class : example.com-sriov-pf
18
+ - name : netdev0 # not used, but required
19
+ source :
20
+ forClass :
21
+ className : example.com-sriov-vf
22
+ - name : netdev1 # not used, but required
23
+ source :
24
+ forClass :
25
+ className : example.com-sriov-vf
26
+ - name : netdev2 # not used, but required
27
+ source :
28
+ forClass :
29
+ className : example.com-sriov-pf
Original file line number Diff line number Diff line change 1
1
# A Pod with two secondary SR-IOV VF interfaces, but
2
2
# both from the same physical card (not necessarily the same PF though).
3
3
#
4
- apiVersion : devmgmtproto .k8s.io/v1alpha1
5
- kind : DeviceClaim
4
+ apiVersion : resource .k8s.io/v1alpha1
5
+ kind : ResourceClaimTemplate
6
6
metadata :
7
- name : template- example.com-sriov-two-vfs-same-card
7
+ name : example.com-sriov-two-vfs-same-card
8
8
namespace : default
9
9
spec :
10
10
devices :
11
- - name : netdevs # required but not used
12
- allOf :
13
- - class : example.com-sriov-vf
14
- matchAttributes :
15
- - hwdevname
16
- requests :
17
- devices : 2
11
+ - resourceClassName : example.com-sriov-vf
12
+ match :
13
+ - attribute : hwdevname.example.com-sriov
14
+ count :
15
+ minimum : 2
18
16
---
19
- apiVersion : v1
17
+ apiVersion : resource.k8s.io/v1alpha1
20
18
kind : Pod
21
19
metadata :
22
20
name : multi-net
29
27
requests :
30
28
cpu : 10m
31
29
memory : 10Mi
32
- deviceClaims :
33
- template :
34
- claimName : template- example.com-sriov-two-vfs-same-card
30
+ resourceClaims :
31
+ - source :
32
+ resourceClaimTemplateName : example.com-sriov-two-vfs-same-card
Original file line number Diff line number Diff line change 2
2
# both from the same PF on the same card ("pf" is just
3
3
# an index, so it needs the card name to qualify it).
4
4
#
5
- apiVersion : devmgmtproto .k8s.io/v1alpha1
6
- kind : DeviceClaim
5
+ apiVersion : resource .k8s.io/v1alpha2
6
+ kind : ResourceClaimTemplate
7
7
metadata :
8
- name : template- example.com-sriov-two-vfs-same-pf
8
+ name : example.com-sriov-two-vfs-same-pf
9
9
namespace : default
10
10
spec :
11
- devices :
12
- - name : netdevs # required but not used
13
- allOf :
14
- - class : example.com-sriov-vf
15
- matchAttributes :
16
- - hwdevname
17
- - pf
18
- requests :
19
- devices : 2
11
+ spec :
12
+ requests :
13
+ - resourceClassName : example.com-sriov-vf
14
+ match :
15
+ - attribute : hwdevname.example.com-sriov
16
+ - attribute : pf.example.com-sriov
17
+ count :
18
+ minimum : 2
20
19
---
20
+ apiVersion : resource.k8s.io/v1alpha2
21
21
apiVersion : v1
22
22
kind : Pod
23
23
metadata :
31
31
requests :
32
32
cpu : 10m
33
33
memory : 10Mi
34
- deviceClaims :
35
- template :
36
- claimName : template- example.com-sriov-two-vfs-same-pf
34
+ resourceClaims :
35
+ - source :
36
+ resourceClaimTemplateName : example.com-sriov-two-vfs-same-pf
Original file line number Diff line number Diff line change 3
3
# since example.org does things differently. But if we can agree on the right
4
4
# conventions, we will be better off.
5
5
#
6
- apiVersion : devmgmtproto .k8s.io/v1alpha1
7
- kind : DeviceClaim
6
+ apiVersion : resource .k8s.io/v1alpha2
7
+ kind : ResourceClaimTemplate
8
8
metadata :
9
- name : template- sriov-two-vfs
9
+ name : sriov-two-vfs
10
10
namespace : default
11
11
spec :
12
- devices :
13
- - name : netdevs # required but not used
14
- allOf :
15
- - class : sriov-nic # this is our cross-driver label selector based class
16
- constraints : " device.sriovType == 'vf'"
17
- devices : 2
12
+ spec :
13
+ requests :
14
+ - resourceClassName : sriov-nic # this is our cross-driver label selector based class
15
+ filter :
16
+ - device :
17
+ selector : " device.stringAttributes['type.nic.k8s.io']== 'vf'"
18
+ count :
19
+ minimum : 2
18
20
---
19
- apiVersion : v1
21
+ apiVersion : resource.k8s.io/v1alpha2
20
22
kind : Pod
21
23
metadata :
22
24
name : multi-net
29
31
requests :
30
32
cpu : 10m
31
33
memory : 10Mi
32
- deviceClaims :
33
- template :
34
- claimName : template- sriov-two-vfs
34
+ resourceClaims :
35
+ - source :
36
+ resourceClaimTemplateName : sriov-two-vfs
Original file line number Diff line number Diff line change 3
3
# example.com, we need a different style of claim. This uses per-device
4
4
# requests. Seems worse to me.
5
5
#
6
- apiVersion : devmgmtproto .k8s.io/v1alpha1
7
- kind : DeviceClaim
6
+ apiVersion : resource .k8s.io/v1alpha2
7
+ kind : ResourceClaimTemplate
8
8
metadata :
9
- name : template- example.org-sriov-vf
9
+ name : example.org-sriov-vf
10
10
namespace : default
11
11
spec :
12
- devices :
13
- - name : netdevs # required but not used
14
- allOf :
15
- - class : example.org-sriov-nic
16
- requests :
17
- vf : 1
12
+ spec :
13
+ requests :
14
+ - resourceClassName : example.org-sriov-nic
15
+ filter :
16
+ - device :
17
+ selector : " device.quantityAttributes['vf.example.org-sriov'].compareTo(quantity('1')) >= 0 "
18
18
---
19
19
apiVersion : v1
20
20
kind : Pod
29
29
requests :
30
30
cpu : 10m
31
31
memory : 10Mi
32
- deviceClaims :
33
- template :
34
- claimName : template- example.org-sriov-vf
32
+ resourceClaims :
33
+ - source :
34
+ resourceClaimTemplateName : example.org-sriov-vf
Original file line number Diff line number Diff line change @@ -27,32 +27,37 @@ metadata:
27
27
name : greennet
28
28
namespace : default
29
29
---
30
- apiVersion : devmgmtproto .k8s.io/v1alpha1
31
- kind : DeviceClaim
30
+ apiVersion : resource .k8s.io/v1alpha2
31
+ kind : ResourceClaimTemplate
32
32
metadata :
33
- name : template- sriov-blue-red-green
33
+ name : sriov-blue-red-green
34
34
namespace : default
35
35
spec :
36
- devices :
37
- - name : ip-networks
38
- allOf :
39
- - class : sriov-nic
36
+ spec :
37
+ requests :
38
+ - resourceClassName : sriov-nic
40
39
config :
41
- - apiVersion : fabric.example.com/v1alpha1
42
- kind : IPNetwork
43
- name : bluenet
44
- - class : sriov-nic
40
+ vendor :
41
+ - parameters :
42
+ apiVersion : fabric.example.com/v1alpha1
43
+ kind : IPNetwork
44
+ name : bluenet
45
+ - resourceClassName : sriov-nic
45
46
config :
46
- - apiVersion : fabric.example.com/v1alpha1
47
- kind : IPNetwork
48
- name : rednet
49
- - class : sriov-nic
47
+ vendor :
48
+ - parameters :
49
+ apiVersion : fabric.example.com/v1alpha1
50
+ kind : IPNetwork
51
+ name : rednet
52
+ - resourceClassName : sriov-nic
50
53
config :
51
- - apiVersion : fabric.example.com/v1alpha1
52
- kind : IPNetwork
53
- name : greennet
54
+ vendor :
55
+ - parameters :
56
+ apiVersion : fabric.example.com/v1alpha1
57
+ kind : IPNetwork
58
+ name : greennet
54
59
---
55
- apiVersion : v1
60
+ apiVersion : resource.k8s.io/v1alpha2
56
61
kind : Pod
57
62
metadata :
58
63
name : blue-red-green
65
70
requests :
66
71
cpu : 10m
67
72
memory : 10Mi
68
- deviceClaims :
69
- template :
70
- claimName : template- sriov-blue-red-green
73
+ resourceClaims :
74
+ - source :
75
+ resourceClaimTemplateName : sriov-blue-red-green
Original file line number Diff line number Diff line change 3
3
# Probably in real life this is almost never needed, because you would
4
4
# usually only have on vendor's cards in a given node.
5
5
#
6
- apiVersion : devmgmtproto .k8s.io/v1alpha1
7
- kind : DeviceClaim
6
+ apiVersion : resource .k8s.io/v1alpha2
7
+ kind : ResourceClaimTemplate
8
8
metadata :
9
- name : template- sriov-four-same-vendor
9
+ name : sriov-four-same-vendor
10
10
namespace : default
11
11
spec :
12
- devices :
13
- - name : netdevs # required but not used
14
- allOf :
15
- - class : sriov-nic
16
- matchAttributes :
17
- - vendor
18
- devices : 4
12
+ spec :
13
+ requests :
14
+ - resourceClassName : sriov-nic
15
+ match :
16
+ - attribute : vendor.dra.k8s.io
17
+ count :
18
+ minimum : 4
19
19
---
20
- apiVersion : v1
20
+ apiVersion : resource.k8s.io/v1alpha2
21
21
kind : Pod
22
22
metadata :
23
23
name : multi-net
30
30
requests :
31
31
cpu : 10m
32
32
memory : 10Mi
33
- deviceClaims :
34
- template :
35
- claimName : template- sriov-four-same-vendor
33
+ resourceClaims :
34
+ - source :
35
+ resourceClaimTemplateName : sriov-four-same-vendor
Original file line number Diff line number Diff line change 4
4
# NOTE: `distinctAttributes` is not actually in the model yet. Is it
5
5
# useful?
6
6
#
7
- apiVersion : devmgmtproto .k8s.io/v1alpha1
8
- kind : DeviceClaim
7
+ apiVersion : resource .k8s.io/v1alpha2
8
+ kind : ResourceClaimTemplate
9
9
metadata :
10
- name : template- sriov-four-same-vendor-diff-cards
10
+ name : sriov-four-same-vendor-diff-cards
11
11
namespace : default
12
12
spec :
13
- devices :
14
- - name : netdevs # required but not used
15
- allOf :
16
- - class : sriov-nic
17
- matchAttributes :
18
- - vendor
19
- distinctAttributes :
20
- - hwdevname
21
- devices : 4
13
+ spec :
14
+ requests :
15
+ - resourceClassName : sriov-nic
16
+ match :
17
+ - attribute : vendor.dra.k8s.io
18
+ # - expression: "device.distinctAttributes('hwdevname.dra.k8s.io')"
19
+ count :
20
+ minimum : 4
22
21
---
23
- apiVersion : v1
22
+ apiVersion : resource.k8s.io/v1alpha2
24
23
kind : Pod
25
24
metadata :
26
25
name : multi-net
33
32
requests :
34
33
cpu : 10m
35
34
memory : 10Mi
36
- deviceClaims :
37
- template :
38
- claimName : template- sriov-four-same-vendor-diff-cards
35
+ resourceClaims :
36
+ - source :
37
+ resourceClaimTemplateName : sriov-four-same-vendor-diff-cards
You can’t perform that action at this time.
0 commit comments