Skip to content

Commit

Permalink
Merge pull request nusdbsystem#62 from naili-xing/dev
Browse files Browse the repository at this point in the history
Add gpu plugin configurations
  • Loading branch information
NLGithubWP authored May 20, 2020
2 parents 6d1d3aa + 00dbfa7 commit 1a1711f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/kubernetes/nvidia-device-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nvidia-device-plugin-daemonset-1.12
namespace: kube-system
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
# Mark this pod as a critical add-on; when enabled, the critical add-on scheduler
# reserves resources for critical add-on pods so that they can be rescheduled after
# a failure. This annotation works in tandem with the toleration below.
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
labels:
name: nvidia-device-plugin-ds
spec:
tolerations:
# Allow this pod to be rescheduled while the node is in "critical add-ons only" mode.
# This, along with the annotation above marks this pod as a critical add-on.
- key: CriticalAddonsOnly
operator: Exists
- key: nvidia.com/gpu
operator: Exists
effect: NoSchedule
containers:
- image: nvidia/k8s-device-plugin:1.11
name: nvidia-device-plugin-ctr
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
volumeMounts:
- name: device-plugin
mountPath: /var/lib/kubelet/device-plugins
volumes:
- name: device-plugin
hostPath:
path: /var/lib/kubelet/device-plugins
2 changes: 2 additions & 0 deletions scripts/kubernetes/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ echo "Deploy ingress-nginx"
# customer yaml: add replica to 3, fix the port to 3005
kubectl apply -f scripts/kubernetes/ingress_controller_deploy.yaml || exit 1
fi
echo "Deploy GPU plugin"

kubectl create -f ./scripts/kubernetes/nvidia-device-plugin.yml

echo "To use Rafiki, use Rafiki Client in the Python CLI"
echo "A quickstart is available at https://nginyc.github.io/rafiki/docs/latest/docs/src/user/quickstart.html"
Expand Down

0 comments on commit 1a1711f

Please sign in to comment.