smarter-device-manager

by gabe565

Helm chartv0.5.2App v1.20.11Verified publisher

Manage hardware resource allocation without a need for privileged containers.

About this chart

Smarter Device Manager

Manage hardware resource allocation without a need for privileged containers.

Homepage: https://charts.gabe565.com/charts/smarter-device-manager/

This chart is not maintained by the upstream project and any issues with the chart should be raised here

Source Code

Requirements

Kubernetes: >=1.22.0-0

Dependencies

RepositoryNameVersion
https://bjw-s.github.io/helm-chartscommon1.5.1

Installing the Chart

To install the chart with the release name smarter-device-manager

OCI (Recommended)

helm install smarter-device-manager oci://ghcr.io/gabe565/charts/smarter-device-manager

Traditional

helm repo add gabe565 https://charts.gabe565.com
helm repo update
helm install smarter-device-manager gabe565/smarter-device-manager

Uninstalling the Chart

To uninstall the smarter-device-manager deployment

helm uninstall smarter-device-manager

The command removes all the Kubernetes components associated with the chart including persistent volumes and deletes the release.

Configuration

Read through the values.yaml file. It has several commented out suggested values. Other values may be used from the values.yaml from the bjw-s common library.

Specify each parameter using the --set key=value[,key=value] argument to helm install.

helm install smarter-device-manager \
  --set env.TZ="America/New York" \
    gabe565/smarter-device-manager

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

helm install smarter-device-manager gabe565/smarter-device-manager -f values.yaml

Custom configuration

Please consider overriding the default configuration through values.yaml. For example:

config: |
  - devicematch: ^snd$
    nummaxdevices: 20
  - devicematch: ^rtc0$
    nummaxdevices: 20
  - devicematch: ^video[0-9]*$
    nummaxdevices: 20
  - devicematch: ^ttyACM[0-9]*$
    nummaxdevices: 1

The above configuration allows up to twenty pods to make use of /dev/snd, /dev/rtc0 and each of /dev/video[0-9]* devices. Only one pod at a time can use any of the discovered host /dev/ttyACM[0-9]* devices. This means that if a pod has reserved a dongle at /dev/ttyACM0, another pod requesting the same device will stay pending.

Once the devices are discovered, they will be added as allocatable resources to the nodes:

 $ kubectl describe nodes
...
Capacity:
  cpu:                                  4
  memory:                               16104560Ki
  pods:                                 110
  smarter-devices/gpiochip0:            0
  smarter-devices/i2c-0:                0
  smarter-devices/snd:                  20
  smarter-devices/ttyUSB-Z-Stick-Gen5:  1

The hardware is requested by pods through resources, e.g.:

  resources:
    limits:
      smarter-devices/ttyUSB-Conbee-2: 1
    requests:
      smarter-devices/ttyUSB-Conbee-2: 1

In this case host device /dev/ttyUSB-Conbee-2 will be given at the same path, and the pod will only be created when this device is available.

Values

Important: When deploying an application Helm chart you can add more values from the bjw-s common library chart here

KeyTypeDefaultDescription
configstringSee values.yamlOverride default configuration [ref]
hostNetworkbooltrueWhen using hostNetwork make sure you set dnsPolicy to ClusterFirstWithHostNet
image.pullPolicystring"IfNotPresent"image pull policy
image.repositorystring"registry.gitlab.com/arm-research/smarter/smarter-device-manager"image repository
image.tagstring"v1.20.11"image tag
persistenceobjectSee values.yamlConfigure persistence settings for the chart under this key.
priorityClassNamestring"system-node-critical"Custom priority class for different treatment by the scheduler Setting this is not necessary, but it is recommended. [ref]
securityContextobjectSee values.yamlConfigure the securityContext for this pod [ref]
termination.messagePathstring"/var/log/termination-log"Configure the path at which the file to which the main container's termination message will be written. Overrides the default of /dev/termination-log to allow read-only persistence.devfs at /dev. [ref]
termination.messagePolicystring"FallbackToLogsOnError"Indicate how the main container's termination message should be populated. Valid options are File and FallbackToLogsOnError. smarter-device-manager does not support a termination-log, so use the container's log. [ref]

Autogenerated from chart metadata using helm-docs

Deploy smarter-device-manager with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has smarter-device-manager on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsmarter-device-manager is pinned at v0.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply