View the capacity of the current node
Capacity:
cpu: 4
ephemeral-storage: 50824704Ki
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 8123340Ki
pods: 110
If you want to add a new capacity in the status field above, you must use the patch API
Start proxy
kubectl proxy
Add new capacity
curl --header "Content-Type: application/json-patch+json" \
--request PATCH \
--data '[{"op": "add", "path": "/status/capacity/studyk8s.com~1lizhe", "value": "4"}]' \
http://localhost:8001/api/v1/nodes/k1/status
curl --header "Content-Type: application/json-patch+json" \
--request PATCH \
--data '[{"op": "remove", "path": "/status/capacity/studyk8s.com~1lizhe"}]' \
http://localhost:8001/api/v1/nodes/k1/status
The above code will generate studyk8s com/lizhe: 4
Then it can be used in Dep
resources:
limits:
studyk8s.com/lizhe: 4
So studyk8s COM / Lizhe has become a resource
Because only node1 has such resources and has been exhausted, it is impossible to deploy multiple nodes