Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/generic-device-plugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.2.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
5 changes: 4 additions & 1 deletion charts/generic-device-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generic-device-plugin

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.0](https://img.shields.io/badge/AppVersion-0.2.0-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.0](https://img.shields.io/badge/AppVersion-0.2.0-informational?style=flat-square)

A Helm chart for deploying the generic-device-plugin on Kubernetes

Expand All @@ -14,8 +14,11 @@ A Helm chart for deploying the generic-device-plugin on Kubernetes

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| args | list | `[]` | additional CLI args appended to the generic-device-plugin container |
| deployPodMonitor | bool | `true` | deploy the podMonitor (requires PodMonitor CRD to be installed) |
| devices | list | `[]` | list of device specs that replace the built-in device args when non-empty. See https://github.com/squat/generic-device-plugin#overview for the schema. |
| fullnameOverride | string | `""` | override the fullname of the chart resources |
| hostPathMounts | list | `[]` | additional hostPath volumes to mount into the container. Each entry: {name, hostPath, mountPath, readOnly?, type?}. IMPORTANT: if any entry has a mountPath of /dev or under /dev/* the default /dev hostPath mount is dropped. |
| image.pullPolicy | string | `"Always"` | image pullPolicy is set to always because tag is set to latest |
| image.repository | string | `"squat/generic-device-plugin"` | container image repo |
| image.tag | string | `"latest"` | Overrides the image tag whose default is the chart appVersion. |
Expand Down
36 changes: 36 additions & 0 deletions charts/generic-device-plugin/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{{- $mountDev := true }}
{{- range .Values.hostPathMounts }}
{{- if or (eq .mountPath "/dev") (hasPrefix "/dev/" .mountPath) }}
{{- $mountDev = false }}
{{- end }}
{{- end }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down Expand Up @@ -34,6 +40,13 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- if .Values.devices }}
{{- range .Values.devices }}
- --device
- |
{{- toYaml . | nindent 12 }}
{{- end }}
{{- else }}
- --device
- |
name: serial
Expand Down Expand Up @@ -92,6 +105,10 @@ spec:
mountPath: /dev/snd/controlC0
- path: /dev/snd/pcmC3D0c
mountPath: /dev/snd/pcmC0D0c
{{- end }}
{{- with .Values.args }}
{{- toYaml . | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
Expand All @@ -102,14 +119,33 @@ spec:
volumeMounts:
- name: device-plugin
mountPath: /var/lib/kubelet/device-plugins
{{- if $mountDev }}
- name: dev
mountPath: /dev
{{- end }}
{{- range .Values.hostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- with .readOnly }}
readOnly: {{ . }}
{{- end }}
{{- end }}
volumes:
- name: device-plugin
hostPath:
path: /var/lib/kubelet/device-plugins
{{- if $mountDev }}
- name: dev
hostPath:
path: /dev
{{- end }}
{{- range .Values.hostPathMounts }}
- name: {{ .name }}
hostPath:
path: {{ .hostPath }}
{{- with .type }}
type: {{ . }}
{{- end }}
{{- end }}
updateStrategy:
type: RollingUpdate
10 changes: 10 additions & 0 deletions charts/generic-device-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ tolerations:
effect: "NoSchedule"
# -- deploy the podMonitor (requires PodMonitor CRD to be installed)
deployPodMonitor: true
# -- additional CLI args appended to the generic-device-plugin container
args: []
# -- additional hostPath volumes to mount into the container.
# Each entry: {name, hostPath, mountPath, readOnly?, type?}.
# IMPORTANT: if any entry has a mountPath of /dev or under /dev/*
# the default /dev hostPath mount is dropped.
hostPathMounts: []
# -- list of device specs that replace the built-in device args when non-empty.
# See https://github.com/squat/generic-device-plugin#overview for the schema.
devices: []
Loading