I am trying to figure out how to update a node's pod capacity. I have a simple cluster setup using the Vagrant/VM environment outlined in the documentation. I have attempted to patch the node's pod capacity using kubectl doing the following:
Sending just JSON needed for patch via:
kubectl patch node 10.245.1.3 -p '{"status": {"capacity": {"pods": "4"}}}'
and
kubectl patch node 10.245.1.3 -p "`cat node.json`"
Where node.json is the nodes JSON from a GET request except with pods change to 4 and the resourceVersion attribute removed.
The command seems to be accepted because the node's resourceVersion number changes. However, the capacity of pods does not. Any ideas?
I am using Kubernetes 1.0.6
NodeStatus is a subresource that is periodically updated by the node (kubelet) itself, and the capacity is calculated based on available resources (cpu, mem, etc) on the node. Updating the Node object does not update the status.
If you want to set a maximum capacity of a node, you can pass a flag to the kubelet during startup. This would require you to restart kubelet though.