克隆仓库
ps: 需要开启 vt-d 功能,否则启动不了。
git clone https://github.com/intel/intel-device-plugins-for-kubernetes -b release-0.23
根据你安装的k8s版本选择 tag分支。
Branch Kubernetes branch/version Status release-0.24 Kubernetes 1.24 branch v1.24.x supported release-0.23 Kubernetes 1.23 branch v1.23.x supported release-0.22 Kubernetes 1.22 branch v1.22.x supported release-0.21 Kubernetes 1.21 branch v1.21.x unsupported release-0.20 Kubernetes 1.20 branch v1.20.x unsupported release-0.19 Kubernetes 1.19 branch v1.19.x unsupported release-0.18 Kubernetes 1.18 branch v1.18.x unsupported release-0.17 Kubernetes 1.17 branch v1.17.x unsupported release-0.15 Kubernetes 1.15 branch v1.15.x unsupported release-0.11 Kubernetes 1.11 branch v1.11.x unsupported
安装k8s intel gpu 管理插件
kubectl apply -k intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/fractional_resources
在其他 pod中使用gpu功能:
在
resources
中的limits
中增加一项gpu.intel.com/i915: '1'
即可
例如:
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
k8s.kuboard.cn/name: plex
name: plex
namespace: plex
resourceVersion: '3349090'
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: plex
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: plex
spec:
containers:
....
- image: 'linuxserver/plex:latest'
resources:
limits:
cpu: '1'
gpu.intel.com/i915: '1'
memory: 1000Mi
requests:
cpu: 50m
gpu.intel.com/i915: '1'
memory: 200Mi
....