Created
January 17, 2026 22:28
-
-
Save anthonybudd/cececdba0a748b99e1b4734309fc6839 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| sudo apt install -y apt-transport-https ca-certificates curl | |
| curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key \ | |
| | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg | |
| echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] \ | |
| https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /" \ | |
| | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
| sudo apt update | |
| sudo apt install -y kubelet kubeadm kubectl | |
| sudo apt-mark hold kubelet kubeadm kubectl | |
| sudo swapoff -a | |
| sudo sed -i '/ swap / s/^/#/' /etc/fstab | |
| sudo kubeadm init --pod-network-cidr=10.244.0.0/16 | |
| mkdir -p $HOME/.kube | |
| sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config | |
| sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
| kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml | |
| kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.15.0/nvidia-device-plugin.yml | |
| kubectl get pods -n kube-system | |
| kubectl describe node | grep -A5 Capacity | |
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: gpu-test | |
| spec: | |
| restartPolicy: Never | |
| containers: | |
| - name: cuda | |
| image: nvidia/cuda:12.2.0-base-ubuntu22.04 | |
| resources: | |
| limits: | |
| nvidia.com/gpu: 1 | |
| command: ["nvidia-smi"] | |
| kubectl apply -f gpu-test.yaml | |
| kubectl logs gpu-test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment