Skip to content

Commit

Permalink
fix: update docs and update the registration method to use the proper…
Browse files Browse the repository at this point in the history
… interface/plugin type

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Dec 19, 2024
1 parent 4b9b431 commit a9f4b56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ clusterrolebinding.rbac.authorization.k8s.io/power-device-plugin created
daemonset.apps/power-device-plugin created
```

#### Debug DaemonSet
To debug the running plugin, you can use:

```
Expand All @@ -29,6 +30,20 @@ export GRPC_GO_LOG_SEVERITY_LEVEL=info

Thse are commented out in the DaemonSet.

#### Debug Kubelet

You can check the kubelet behavior using:

```
# journalctl -u kubelet
...
7446 handler.go:95] "Registered client" name="power-dev-plugin/dev"
wrapper[7446]: I1219 04:32:20.722778 7446 manager.go:230] "Device plugin connected" resourceName="power-dev-plugin/dev"
wrapper[7446]: I1219 04:32:20.723559 7446 client.go:93] "State pushed for device plugin" resource="power-dev-plugin/dev" re>
wrapper[7446]: I1219 04:32:20.726284 7446 manager.go:279] "Processed device updates for resource" resourceName="power-dev-p>
wrapper[7446]: I1219 04:32:27.293908 7446 setters.go:333] "Updated capacity for device plugin" plugin="power-dev-plugin/dev>
```

### Sample

1. To deploy the sample: `kustomize build examples | oc apply -f -`
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type PowerPlugin struct {

server *grpc.Server

p pluginapi.DevicePluginServer
pluginapi.DevicePluginServer
}

// Creates a Plugin
Expand Down Expand Up @@ -88,7 +88,7 @@ func (m *PowerPlugin) Start() error {
}

m.server = grpc.NewServer()
pluginapi.RegisterDevicePluginServer(m.server, m.p)
pluginapi.RegisterDevicePluginServer(m.server, m)

// start serving from grpcServer
go func() {
Expand Down

0 comments on commit a9f4b56

Please sign in to comment.