-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher Desiniotis <[email protected]>
- Loading branch information
1 parent
fe9595a
commit 2f5127f
Showing
18 changed files
with
922 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nvidia-dra-driver | ||
namespace: "FILLED BY THE OPERATOR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: nvidia-dra-driver | ||
rules: | ||
# TODO: restrict RBAC for DRA driver | ||
- apiGroups: | ||
- "" | ||
- apps | ||
- resource.k8s.io | ||
- gpu.nvidia.com | ||
resources: | ||
- '*' | ||
verbs: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: nvidia-dra-driver | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: nvidia-dra-driver | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nvidia-dra-driver | ||
namespace: "FILLED BY THE OPERATOR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: resource.k8s.io/v1alpha3 | ||
kind: DeviceClass | ||
metadata: | ||
name: imex.nvidia.com | ||
spec: | ||
selectors: | ||
- cel: | ||
expression: "device.driver == 'gpu.nvidia.com' && device.attributes['gpu.nvidia.com'].type == 'imex-channel'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: nvidia-dra-driver-controller | ||
name: nvidia-dra-driver-controller | ||
namespace: "FILLED BY THE OPERATOR" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nvidia-dra-driver-controller | ||
template: | ||
metadata: | ||
labels: | ||
app: nvidia-dra-driver-controller | ||
spec: | ||
priorityClassName: system-node-critical | ||
serviceAccountName: nvidia-dra-driver | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/control-plane | ||
operator: Exists | ||
containers: | ||
- name: controller | ||
image: "FILLED BY THE OPERATOR" | ||
imagePullPolicy: IfNotPresent | ||
command: ["nvidia-dra-controller", "-v", "6"] | ||
env: | ||
- name: DEVICE_CLASSES | ||
value: imex | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: metadata.name | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: metadata.namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nvidia-dra-driver-kubelet-plugin-entrypoint | ||
namespace: "FILLED BY THE OPERATOR" | ||
labels: | ||
app: nvidia-dra-driver-kubelet-plugin | ||
data: | ||
entrypoint.sh: |- | ||
#!/bin/bash | ||
until [[ -f /run/nvidia/validations/driver-ready ]] | ||
do | ||
echo "waiting for the driver validations to be ready..." | ||
sleep 5 | ||
done | ||
set -o allexport | ||
cat /run/nvidia/validations/driver-ready | ||
. /run/nvidia/validations/driver-ready | ||
# TODO: add an alias for DRIVER_ROOT_CTR_PATH in the k8s-dra-driver and remove the below export | ||
export CONTAINER_DRIVER_ROOT=$DRIVER_ROOT_CTR_PATH | ||
# Conditionally mask the params file to prevent this container from | ||
# recreating any missing GPU device nodes. This is necessary, for | ||
# example, when running under nvkind to limit the set GPUs governed | ||
# by the plugin even though it has cgroup access to all of them. | ||
if [ "${MASK_NVIDIA_DRIVER_PARAMS}" = "true" ]; then | ||
cp /proc/driver/nvidia/params root/gpu-params | ||
sed -i 's/^ModifyDeviceFiles: 1$/ModifyDeviceFiles: 0/' root/gpu-params | ||
mount --bind root/gpu-params /proc/driver/nvidia/params | ||
fi | ||
echo "Starting nvidia-dra-plugin" | ||
exec nvidia-dra-plugin |
Oops, something went wrong.