Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying the Device Plugin Image

Deploy the device plugin image on all worker nodes.

  1. Install Golang 1.17 or later.
    1
    yum install golang
    
  2. Download the device plugin code and switch to the specified commit ID.
    1
    2
    3
    git clone https://github.com/everpeace/k8s-host-device-plugin.git
    cd  k8s-host-device-plugin
    git checkout 15e0a180dd4fbea7ea09b563b9e0713d3b90579a
    
  3. Integrate device-plugin.patch.

    Copy device-plugin.patch (in the k8s/DevicesPlugin folder of DemoVideoEngine.tar.gz) to the k8s-host-device-plugin directory.

    1
    2
    cd k8s-host-device-plugin
    patch -p1 < device-plugin.patch
    
  4. Build the device plugin.
    1
    2
    3
    # Change the mirror site of Go.
    export GOPROXY=https://goproxy.cn
    go build
    
  5. Build an image.
    1
    2
    docker build -f Dockerfile  -t k8s-hostdev-plugin:0.1 .
    docker save k8s-hostdev-plugin:0.1 -o k8s-hostdev-plugin.tar
    
  6. Import the image.

    Copy k8s-hostdev-plugin.tar to all worker nodes and import the image.

    1
    ctr -n k8s.io images import k8s-hostdev-plugin.tar