Specifying Extended Resources in Kubelet Configuration

11/28/2019

Is it possible to specify extended resources in Kubelet configuration or would this need to be achieved using something like a daemon pod?

An extended resource in this context refers to this: https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/. This page specifies that the way to advertise these resources is to send a patch to the nodes /status endpoint like so:

curl --header "Content-Type: application/json-patch+json" \ --request PATCH \ --data '[{"op": "add", "path": "/status/capacity/example.com~1dongle", "value": "4"}]' \ http://localhost:8001/api/v1/nodes/<your-node-name>/status

-- Matt Brown
devops
kubelet
kubernetes

1 Answer

11/29/2019

Is it possible to specify extended resources in Kubelet configuration or would this need to be achieved using something like a daemon pod?

No, extended resources cannot be specified just in Kubelet configuration. If you want to configure them permanently, you can use Device Plugins.

You can deploy a device plugin as a DaemonSet, as a package for your node’s operating system, or manually.

The canonical directory /var/lib/kubelet/device-plugins requires privileged access, so a device plugin must run in a privileged security context. If you’re deploying a device plugin as a DaemonSet, /var/lib/kubelet/device-plugins must be mounted as a Volume in the plugin’s PodSpec.

If you choose the DaemonSet approach you can rely on Kubernetes to: place the device plugin’s Pod onto Nodes, to restart the daemon Pod after failure, and to help automate upgrades.

-- mario
Source: StackOverflow