Skip to content

Commit

Permalink
fix(hardware): Add device plugin for TUN
Browse files Browse the repository at this point in the history
  • Loading branch information
eaglesemanation committed Dec 31, 2024
1 parent 0430c49 commit 8241c99
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
14 changes: 14 additions & 0 deletions k8s/apps/hardware/generic-device-plugin.k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: generic-device-plugin
namespace: flux-system
spec:
interval: 10m
path: ./k8s/apps/hardware/generic-device-plugin
prune: true
sourceRef:
kind: GitRepository
name: emnt-ops
wait: true
66 changes: 66 additions & 0 deletions k8s/apps/hardware/generic-device-plugin/daemonset.k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: generic-device-plugin
namespace: generic-device-plugin
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: tun
groups:
- count: 1000
paths:
- path: /dev/net/tun
- --device
- |
name: sonoff-zigbee
groups:
- usb:
vendor: 10c4
product: ea60
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
5 changes: 5 additions & 0 deletions k8s/apps/hardware/generic-device-plugin/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.k8s.yaml
- daemonset.k8s.yaml
6 changes: 6 additions & 0 deletions k8s/apps/hardware/generic-device-plugin/namespace.k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: generic-device-plugin
labels:
pod-security.kubernetes.io/enforce: privileged
1 change: 1 addition & 0 deletions k8s/apps/hardware/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ resources:
- node-feature-discovery.k8s.yaml
- intel-device-plugins.k8s.yaml
- zigbee-adapter-discovery.k8s.yaml
- generic-device-plugin.k8s.yaml

0 comments on commit 8241c99

Please sign in to comment.