Skip to content

mewz-project/waiot-dra-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

waiot-dra-driver

A Kubernetes Dynamic Resource Allocation (DRA) driver for waiot to manage GPIO devices as schedulable resources.

Overview

waiot-dra-driver enables Kubernetes to manage GPIO (General Purpose Input/Output) devices as schedulable resources. It implements the DRA Kubelet plugin interface to:

  • Allocate GPIO resources to pods via ResourceClaims
  • Map virtual GPIO pins to physical pins, enabling portable workloads
  • Communicate GPIO mappings to the node endpoint for runtime configuration

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     Kubernetes Cluster                      │
│                                                             │
│  ┌──────────────┐     ┌─────────────────────────────────┐   │
│  │   Scheduler  │────▶│  ResourceSlice (GPIO devices)   │   │
│  └──────────────┘     └─────────────────────────────────┘   │
│         │                          ▲                        │
│         ▼                          │                        │
│  ┌──────────────┐     ┌────────────┴────────────────────┐   │
│  │ ResourceClaim│     │       waiot-dra-driver          │   │
│  │  (Pod wants  │────▶│  ┌─────────────────────────┐    │   │
│  │   GPIO pin)  │     │  │  Kubelet DRA Plugin     │    │   │
│  └──────────────┘     │  │  - Prepare/Unprepare    │    │   │
│                       │  │  - GPIO Pin Mapping     │    │   │
│                       │  └───────────┬─────────────┘    │   │
│                       └──────────────┼──────────────────┘   │
│                                      ▼                      │
│                       ┌─────────────────────────────────┐   │
│                       │     Node Endpoint (HTTP)        │   │
│                       └─────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘

Usage

Defining a ResourceClaim

To request a GPIO device, create a ResourceClaim with the appropriate configuration:

apiVersion: resource.k8s.io/v1
kind: ResourceClaim
metadata:
  name: gpio-claim
spec:
  devices:
    requests:
      - name: sensor
        deviceClassName: gpio-devices
    config:
      - requests: ["sensor"]
        opaque:
          driver: gpio.example.com
          parameters:
            apiVersion: gpio.resource.example.com/v1alpha1
            kind: GpioConfig
            pin: 18  # Virtual pin the application expects

Pod Specification

Reference the ResourceClaim in your pod:

apiVersion: v1
kind: Pod
metadata:
  name: sensor-app
spec:
  containers:
    - name: app
      image: my-iot-app:latest
      resources:
        claims:
          - name: sensor
  resourceClaims:
    - name: sensor
      resourceClaimName: gpio-claim

License

This project is licensed under the Apache License 2.0. See LICENSE for details.

This project includes software developed by The Kubernetes Authors. See NOTICE for attribution.

About

DRA driver for waiot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages