try using a device plugin

This commit is contained in:
nyxerinys 2026-07-03 08:42:34 -05:00
parent 5eb30305f6
commit ea7f50bf9d
4 changed files with 131 additions and 16 deletions

View file

@ -0,0 +1,105 @@
{ ... }:
{
fuse-devPlug.contents = [
{
apiVersion = "apps/v1";
kind = "DaemonSet";
metadata = {
name = "generic-device-plugin";
namespace = "kube-system";
labels = {
"app.kubernetes.io/name" = "generic-device-plugin";
};
};
spec = {
selector = {
matchLabels = {
"app.kubernetes.io/name" = "generic-device-plugin";
};
};
template = {
metadata = {
labels = {
"app.kubernetes.io/name" = "generic-device-plugin";
};
};
spec = {
priorityClassName = "system-node-critical";
tolerations = [
{
operator = "Exists";
effect = "NoExecute";
}
{
operator = "Exists";
effect = "NoSchedule";
}
];
containers = [
{
image = "squat/generic-device-plugin";
args = [
"--device"
''
name: fuse
groups:
- count: 10
paths:
- path: /dev/fuse
''
];
name = "generic-device-plugin";
resources = {
requests = {
cpu = "50m";
memory = "10Mi";
};
limits = {
cpu = "50m";
memory = "20Mi";
};
};
ports = [
{
containerPort = 8080;
name = "http";
}
];
securityContext = {
privileged = true;
};
volumeMounts = [
{
name = "device-plugin";
mountPath = "/var/lib/kubelet/device-plugins";
}
{
name = "dev";
mountPath = "/dev";
}
];
}
];
volumes = [
{
name = "device-plugin";
hostPath = {
path = "/var/lib/kubelet/device-plugins";
};
}
{
name = "dev";
hostPath = {
path = "/dev";
};
}
];
};
};
updateStrategy = {
type = "RollingUpdate";
};
};
}
];
}