https://github.com/ghokun/k8s-device-plugin-demo
Kubernetes device plugin with resource allocation metrics
https://github.com/ghokun/k8s-device-plugin-demo
device-plugin kubernetes
Last synced: 3 months ago
JSON representation
Kubernetes device plugin with resource allocation metrics
- Host: GitHub
- URL: https://github.com/ghokun/k8s-device-plugin-demo
- Owner: ghokun
- Created: 2022-03-06T21:02:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-08T07:41:35.000Z (about 3 years ago)
- Last Synced: 2024-11-15T00:58:27.990Z (6 months ago)
- Topics: device-plugin, kubernetes
- Language: Go
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Demo for Kubernetes Device Plugin
```bash
# Create a kubernetes instance with kind
kind create cluster --image kindest/node:v1.20.7# Build plugin
./download-deps.sh v1.20.7
docker build . -t k8s-device-plugin-demo:0.0.1# Remove deprecation file (device plugin stub does not register device if this file exists)
docker exec -d kind-control-plane rm /var/lib/kubelet/device-plugins/DEPRECATION# Load image to kind
kind load docker-image k8s-device-plugin-demo:0.0.1# Run plugin
kubectl create -f daemonset.yaml# Run a consumer pod
kubectl create -f consumer.yaml# Check metrics (change pod name accordingly)
kubectl port-forward pod/k8s-device-plugin-demo-daemonset-pnb86 --address 0.0.0.0 2112:2112
curl -s http://localhost:2112/metrics# Cleanup
kind delete cluster
docker image rm k8s-device-plugin-demo:0.0.1
```