Kubernetes: Difference between revisions
imported>Iceychris m + DNS: setup and debugging |
imported>Iceychris m + miscellaneous: nvidia, shared memory |
||
Line 187: | Line 187: | ||
* uncomment kubernetes-related code again | * uncomment kubernetes-related code again | ||
* <code>nixos-rebuild switch</code> | * <code>nixos-rebuild switch</code> | ||
== Miscellaneous == | |||
=== NVIDIA === | |||
You can use NVIDIA's [https://github.com/NVIDIA/k8s-device-plugin k8s-device-plugin]. | |||
Make <code>nvidia-docker</code> your default docker runtime: | |||
<syntaxhighlight> | |||
virtualisation.docker = { | |||
enable = true; | |||
# use nvidia as the default runtime | |||
enableNvidia = true; | |||
extraOptions = "--default-runtime=nvidia"; | |||
}; | |||
</syntaxhighlight> | |||
Apply their Daemonset: | |||
<syntaxhighlight> | |||
kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/1.0.0-beta4/nvidia-device-plugin.yml | |||
</syntaxhighlight> | |||
=== <code>/dev/shm</code> === | |||
Some applications need enough shared memory to work properly. | |||
Create a new volumeMount for your Deployment: | |||
<syntaxhighlight> | |||
... | |||
volumeMounts: | |||
- mountPath: /dev/shm | |||
name: dshm | |||
... | |||
</syntaxhighlight> | |||
and mark its <code>medium</code> as <code>Memory</code>: | |||
<syntaxhighlight> | |||
... | |||
volumes: | |||
- name: dshm | |||
emptyDir: | |||
medium: Memory | |||
... | |||
</syntaxhighlight> | |||
== Tooling == | == Tooling == |