Enabling dashboard secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/kubernetes-dashboard created service/monitoring-grafana created service/monitoring-influxdb created service/heapster created deployment.extensions/monitoring-influxdb-grafana-v4 created serviceaccount/heapster created configmap/heapster-config created configmap/eventer-config created deployment.extensions/heapster-v1.5.2 created dashboard enabled
1 2 3 4 5 6 7 8 9 10 11 12
$ microk8s.kubectl -n kube-system get pod,svc -o wide Sat Dec 15 14:48:45 2018
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES pod/heapster-v1.5.2-64874f6bc6-nt72k 4/4 Running 0 94s 10.1.1.17 k8s-testing <none> <none> pod/kubernetes-dashboard-654cfb4879-xm8kp 1/1 Running 0 2m26s 10.1.1.13 k8s-testing <none> <none> pod/monitoring-influxdb-grafana-v4-6679c46745-4kv5s 2/2 Running 0 2m25s 10.1.1.14 k8s-testing <none> <none>
Enabling NVIDIA GPU NVIDIA kernel module detected Enabling DNS Applying manifest service/kube-dns created serviceaccount/kube-dns created configmap/kube-dns created deployment.extensions/kube-dns created Restarting kubelet DNS is enabled Applying manifest daemonset.extensions/nvidia-device-plugin-daemonset created NVIDIA is enabled
cat <<EOF | kubectl create -f - apiVersion: v1 kind: Pod metadata: name: gpu-pod spec: restartPolicy: Never containers: - image: nvidia/cuda name: cuda command: ["nvidia-smi"] resources: limits: nvidia.com/gpu: 1 EOF pod "gpu-pod" created
1 2 3 4
$ kubectl get pod -o wide Sat Dec 15 15:20:54 2018
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES gpu-pod 0/1 Completed 0 3m29s 10.1.1.28 k8s-testing <none> <none>
查看Pod log 狀態:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ kubectl logs gpu-pod Sat Dec 15 07:18:53 2018 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 410.79 Driver Version: 410.79 CUDA Version: 10.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 106... Off | 00000000:03:00.0 Off | N/A | | 37% 25C P8 5W / 120W | 0MiB / 6077MiB | 1% Default | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+