11---
2- title : Advertise Opaque Integer Resources for a Node
2+ title : Advertise Extended Resources for a Node
33---
44
55
66{% capture overview %}
77
8- This page shows how to specify opaque integer resources for a Node.
9- Opaque integer resources allow cluster administrators to advertise node-level
8+ This page shows how to specify extended resources for a Node.
9+ Extended resources allow cluster administrators to advertise node-level
1010resources that would otherwise be unknown to Kubernetes.
1111
12- {% include feature-state-deprecated .md %}
12+ {% include feature-state-stable .md %}
1313
1414{% endcapture %}
1515
@@ -31,9 +31,9 @@ kubectl get nodes
3131
3232Choose one of your Nodes to use for this exercise.
3333
34- ## Advertise a new opaque integer resource on one of your Nodes
34+ ## Advertise a new extended resource on one of your Nodes
3535
36- To advertise a new opaque integer resource on a Node, send an HTTP PATCH request to
36+ To advertise a new extended resource on a Node, send an HTTP PATCH request to
3737the Kubernetes API server. For example, suppose one of your Nodes has four dongles
3838attached. Here's an example of a PATCH request that advertises four dongle resources
3939for your Node.
@@ -47,7 +47,7 @@ Host: k8s-master:8080
4747[
4848 {
4949 " op" : " add" ,
50- " path" : " /status/capacity/pod.alpha.kubernetes.io~1opaque-int-resource-dongle " ,
50+ " path" : " /status/capacity/example.com~1dongle " ,
5151 " value" : " 4"
5252 }
5353]
@@ -69,7 +69,7 @@ Replace `<your-node-name>` with the name of your Node:
6969``` shell
7070curl --header " Content-Type: application/json-patch+json" \
7171--request PATCH \
72- --data ' [{"op": "add", "path": "/status/capacity/pod.alpha.kubernetes.io~1opaque-int-resource-dongle ", "value": "4"}]' \
72+ --data ' [{"op": "add", "path": "/status/capacity/example.com~1dongle ", "value": "4"}]' \
7373http://localhost:8001/api/v1/nodes/< your-node-name> /status
7474```
7575
@@ -85,7 +85,7 @@ The output shows that the Node has a capacity of 4 dongles:
8585 "alpha.kubernetes.io/nvidia-gpu": "0",
8686 "cpu": "2",
8787 "memory": "2049008Ki",
88- "pod.alpha.kubernetes.io/opaque-int-resource- dongle": "4",
88+ "example.com/ dongle": "4",
8989```
9090
9191Describe your Node:
@@ -98,53 +98,52 @@ Once again, the output shows the dongle resource:
9898
9999``` yaml
100100Capacity :
101- alpha.kubernetes.io/nvidia-gpu : 0
102- cpu : 2
103- memory : 2049008Ki
104- pod.alpha.kubernetes.io/opaque-int-resource- dongle : 4
101+ alpha.kubernetes.io/nvidia-gpu : 0
102+ cpu : 2
103+ memory : 2049008Ki
104+ example.com/ dongle : 4
105105` ` `
106106
107107Now, application developers can create Pods that request a certain
108108number of dongles. See
109- [Assign Opaque Integer Resources to a Container](/docs/tasks/configure-pod-container/opaque-integer -resource/).
109+ [Assign Extended Resources to a Container](/docs/tasks/configure-pod-container/extended -resource/).
110110
111111## Discussion
112112
113- Opaque integer resources are similar to memory and CPU resources. For example,
113+ Extended resources are similar to memory and CPU resources. For example,
114114just as a Node has a certain amount of memory and CPU to be shared by all components
115115running on the Node, it can have a certain number of dongles to be shared
116116by all components running on the Node. And just as application developers
117117can create Pods that request a certain amount of memory and CPU, they can
118118create Pods that request a certain number of dongles.
119119
120- Opaque integer resources are called opaque because Kubernetes does not
120+ Extended resources are opaque to Kubernetes; Kubernetes does not
121121know anything about what they are. Kubernetes knows only that a Node
122- has a certain number of them. They are called integer resources because
123- they must be advertised in integer amounts. For example, a Node can advertise
124- four dongles, but not 4.5 dongles.
122+ has a certain number of them. Extended resources must be advertised in integer
123+ amounts. For example, a Node can advertise four dongles, but not 4.5 dongles.
125124
126125### Storage example
127126
128127Suppose a Node has 800 GiB of a special kind of disk storage. You could
129- create a name for the special storage, say opaque-int-resource- special-storage.
128+ create a name for the special storage, say example.com/ special-storage.
130129Then you could advertise it in chunks of a certain size, say 100 GiB. In that case,
131130your Node would advertise that it has eight resources of type
132- opaque-int-resource- special-storage.
131+ example.com/ special-storage.
133132
134133` ` ` yaml
135134Capacity :
136135 ...
137- pod.alpha.kubernetes.io/opaque-int-resource- special-storage : 8
136+ example.com/ special-storage : 8
138137` ` `
139138
140139If you want to allow arbitrary requests for special storage, you
141140could advertise special storage in chunks of size 1 byte. In that case, you would advertise
142- 800Gi resources of type opaque-int-resource- special-storage.
141+ 800Gi resources of type example.com/ special-storage.
143142
144143` ` ` yaml
145144Capacity :
146145 ...
147- pod.alpha.kubernetes.io/opaque-int-resource- special-storage : 800Gi
146+ example.com/ special-storage : 800Gi
148147` ` `
149148
150149Then a Container could request any number of bytes of special storage, up to 800Gi.
@@ -162,7 +161,7 @@ Host: k8s-master:8080
162161[
163162 {
164163 " op " : " remove" ,
165- " path " : " /status/capacity/pod.alpha.kubernetes.io~1opaque-int-resource-dongle " ,
164+ " path " : " /status/capacity/example.com~1dongle " ,
166165 }
167166]
168167```
@@ -179,7 +178,7 @@ Replace `<your-node-name>` with the name of your Node:
179178``` shell
180179curl --header " Content-Type: application/json-patch+json" \
181180--request PATCH \
182- --data ' [{"op": "remove", "path": "/status/capacity/pod.alpha.kubernetes.io~1opaque-int-resource-dongle "}]' \
181+ --data ' [{"op": "remove", "path": "/status/capacity/example.com~1dongle "}]' \
183182http://localhost:8001/api/v1/nodes/< your-node-name> /status
184183```
185184
@@ -196,7 +195,7 @@ kubectl describe node <your-node-name> | grep dongle
196195
197196### For application developers
198197
199- * [ Assign Opaque Integer Resources to a Container] ( /docs/tasks/configure-pod-container/opaque-integer -resource/ )
198+ * [ Assign Extended Resources to a Container] ( /docs/tasks/configure-pod-container/extended -resource/ )
200199
201200### For cluster administrators
202201
0 commit comments