From 94e5449a72b3135defe3f1bf686c52221191f2bb Mon Sep 17 00:00:00 2001 From: Alexandre Ferreira Date: Tue, 2 Jun 2020 12:13:09 -0500 Subject: [PATCH] Add configmap to the daemonsets --- smarter-device-manager-configmap-rpi.yaml | 24 ++++++++ smarter-device-manager-k3s-cs.yaml | 72 +++++++++++++++++++++++ smarter-device-manager-k8s-cs.yaml | 69 ++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 smarter-device-manager-configmap-rpi.yaml create mode 100644 smarter-device-manager-k3s-cs.yaml create mode 100644 smarter-device-manager-k8s-cs.yaml diff --git a/smarter-device-manager-configmap-rpi.yaml b/smarter-device-manager-configmap-rpi.yaml new file mode 100644 index 0000000..304ad93 --- /dev/null +++ b/smarter-device-manager-configmap-rpi.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: smarter-device-manager-rpi +data: + conf.yaml: | + - devicematch: ^snd$ + nummaxdevices: 20 + - devicematch: ^gpiomem$ + nummaxdevices: 40 + - devicematch: ^gpiochip[0-9]*$ + nummaxdevices: 20 + - devicematch: ^hci[0-9]*$ + nummaxdevices: 1 + - devicematch: ^i2c-[0-9]*$ + nummaxdevices: 1 + - devicematch: ^rtc0$ + nummaxdevices: 20 + - devicematch: ^video[0-9]*$ + nummaxdevices: 20 + - devicematch: ^vchiq$ + nummaxdevices: 20 + - devicematch: ^vcsm.*$ + nummaxdevices: 20 diff --git a/smarter-device-manager-k3s-cs.yaml b/smarter-device-manager-k3s-cs.yaml new file mode 100644 index 0000000..e508bf4 --- /dev/null +++ b/smarter-device-manager-k3s-cs.yaml @@ -0,0 +1,72 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: < Replace with the namespace to use > + labels: + name: < Replace with the namespace to use > +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: smarter-device-manager + namespace: < Replace with the namespace to use > + labels: + name: smarter-device-manager + role: agent +spec: + selector: + matchLabels: + name: smarter-device-manager + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + name: smarter-device-manager + annotations: + node.kubernetes.io/bootstrap-checkpoint: "true" + spec: + nodeSelector: + smarter-device-manager : enabled + priorityClassName: "system-node-critical" + hostname: smarter-device-management + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + imagePullSecrets: + - name: k8sedgeregcred + containers: + - name: smarter-device-manager + image: registry.gitlab.com/arm-research/smarter/smarter-device-manager/smarter-device-manager:20191204204613 + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + resources: + limits: + cpu: 100m + memory: 15Mi + requests: + cpu: 10m + memory: 15Mi + volumeMounts: + - name: device-plugin + mountPath: /var/lib/kubelet/device-plugins + - name: dev-dir + mountPath: /dev + - name: config + mountPath: /root/config + volumes: + - name: device-plugin + hostPath: + path: /var/lib/rancher/k3s/agent/kubelet/device-plugins + - name: dev-dir + hostPath: + path: /dev + - name: config + configMap: + name: smarter-device-manager-rpi + - name: config + hostPath: + path: /var/lib/rancher/k3s/agent/kubelet/device-plugins + terminationGracePeriodSeconds: 30 diff --git a/smarter-device-manager-k8s-cs.yaml b/smarter-device-manager-k8s-cs.yaml new file mode 100644 index 0000000..f841227 --- /dev/null +++ b/smarter-device-manager-k8s-cs.yaml @@ -0,0 +1,69 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: < Replace with the namespace to use > + labels: + name: < Replace with the namespace to use > +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: smarter-device-manager + namespace: < Replace with the namespace to use > + labels: + name: smarter-device-manager + role: agent +spec: + selector: + matchLabels: + name: smarter-device-manager + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + name: smarter-device-manager + annotations: + node.kubernetes.io/bootstrap-checkpoint: "true" + spec: + nodeSelector: + smarter-device-manager : enabled + priorityClassName: "system-node-critical" + hostname: smarter-device-management + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + imagePullSecrets: + - name: k8sedgeregcred + containers: + - name: smarter-device-manager + image: registry.gitlab.com/arm-research/smarter/smarter-device-manager/smarter-device-manager:20191204204613 + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + resources: + limits: + cpu: 100m + memory: 15Mi + requests: + cpu: 10m + memory: 15Mi + volumeMounts: + - name: device-plugin + mountPath: /var/lib/kubelet/device-plugins + - name: dev-dir + mountPath: /dev + - name: config + mountPath: /root/config + volumes: + - name: device-plugin + hostPath: + path: /var/lib/kubelet/device-plugins + - name: dev-dir + hostPath: + path: /dev + - name: config + configMap: + name: smarter-device-manager-rpi + terminationGracePeriodSeconds: 30