remove annotation
This commit is contained in:
parent
dba75173fd
commit
4d629ed010
4 changed files with 169 additions and 2 deletions
8
modules/k3s/daemon-sets/default.nix
Normal file
8
modules/k3s/daemon-sets/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ cfg, lib, inputs, ... }:
|
||||||
|
let
|
||||||
|
manifests = [
|
||||||
|
./fuse-devPlug.nix
|
||||||
|
];
|
||||||
|
imported = map ( n: import n { inherit cfg lib inputs; } ) manifests;
|
||||||
|
in
|
||||||
|
lib.foldl' lib.recursiveUpdate {} imported
|
||||||
160
modules/k3s/daemon-sets/fuse-devPlug.nix
Normal file
160
modules/k3s/daemon-sets/fuse-devPlug.nix
Normal file
|
|
@ -0,0 +1,160 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
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: serial
|
||||||
|
groups:
|
||||||
|
- paths:
|
||||||
|
- path: /dev/ttyUSB*
|
||||||
|
- paths:
|
||||||
|
- path: /dev/ttyACM*
|
||||||
|
- paths:
|
||||||
|
- path: /dev/tty.usb*
|
||||||
|
- paths:
|
||||||
|
- path: /dev/cu.*
|
||||||
|
- paths:
|
||||||
|
- path: /dev/cuaU*
|
||||||
|
- paths:
|
||||||
|
- path: /dev/rfcomm*
|
||||||
|
''
|
||||||
|
"--device"
|
||||||
|
''
|
||||||
|
name: video
|
||||||
|
groups:
|
||||||
|
- paths:
|
||||||
|
- path: /dev/video0
|
||||||
|
''
|
||||||
|
"--device"
|
||||||
|
''
|
||||||
|
name: fuse
|
||||||
|
groups:
|
||||||
|
- count: 10
|
||||||
|
paths:
|
||||||
|
- path: /dev/fuse
|
||||||
|
''
|
||||||
|
"--device"
|
||||||
|
''
|
||||||
|
name: audio
|
||||||
|
groups:
|
||||||
|
- count: 10
|
||||||
|
paths:
|
||||||
|
- path: /dev/snd
|
||||||
|
''
|
||||||
|
"--device"
|
||||||
|
''
|
||||||
|
name: capture
|
||||||
|
groups:
|
||||||
|
- paths:
|
||||||
|
- path: /dev/snd/controlC0
|
||||||
|
- path: /dev/snd/pcmC0D0c
|
||||||
|
- paths:
|
||||||
|
- path: /dev/snd/controlC1
|
||||||
|
mountPath: /dev/snd/controlC0
|
||||||
|
- path: /dev/snd/pcmC1D0c
|
||||||
|
mountPath: /dev/snd/pcmC0D0c
|
||||||
|
- paths:
|
||||||
|
- path: /dev/snd/controlC2
|
||||||
|
mountPath: /dev/snd/controlC0
|
||||||
|
- path: /dev/snd/pcmC2D0c
|
||||||
|
mountPath: /dev/snd/pcmC0D0c
|
||||||
|
- paths:
|
||||||
|
- path: /dev/snd/controlC3
|
||||||
|
mountPath: /dev/snd/controlC0
|
||||||
|
- path: /dev/snd/pcmC3D0c
|
||||||
|
mountPath: /dev/snd/pcmC0D0c
|
||||||
|
''
|
||||||
|
];
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
template = {
|
template = {
|
||||||
metadata = {
|
metadata = {
|
||||||
labels.app = "storage-combo";
|
labels.app = "storage-combo";
|
||||||
annotations."cdi.k8s.io/cdi.nyxerinys.dev/fuse" = "rw";
|
|
||||||
};
|
};
|
||||||
spec = {
|
spec = {
|
||||||
hostUsers = false;
|
hostUsers = false;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
let
|
let
|
||||||
manifests = [
|
manifests = [
|
||||||
./deployments
|
./deployments
|
||||||
# ./services
|
./daemon-sets
|
||||||
];
|
];
|
||||||
imported = map ( n: import n { inherit cfg lib inputs; } ) manifests;
|
imported = map ( n: import n { inherit cfg lib inputs; } ) manifests;
|
||||||
in
|
in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue