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
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 aDaemonSet
,/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’sPod
ontoNodes
, to restart the daemonPod
after failure, and to help automate upgrades.