So first, let's create our pod.
$ kubectl create -f https://gist.githubusercontent.com/elsonrodriguez/60e53e2479dc3146447b/raw/3b4d703855500c829ae58d70e386b4e41e4f7996/pod.yaml
pod "gputest" created
Now let's see it go:
$ kubectl get pod gputest
NAME READY STATUS RESTARTS AGE
gputest 0/1 Pending 0 17s
Well, it didn't go. Why?
$ kubectl describe pod gputest
....
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
37s 22s 4 {default-scheduler } Warning FailedScheduling pod (gputest) failed to fit in any node
fit failure on node (ip-172-20-0-16.us-west-1.compute.internal): MatchNodeSelector
fit failure on node (ip-172-20-0-14.us-west-1.compute.internal): MatchNodeSelector
fit failure on node (ip-172-20-0-15.us-west-1.compute.internal): MatchNodeSelector
No node matches the nodeSelector! Let's label a node. (replace $nodename with a node, use kubectl get nodes
to see nodes)
$ kubectl label node $nodename gpu=true
Now let's see:
$ kubectl get pods gputest
NAME READY STATUS RESTARTS AGE
gputest 1/1 Running 0 2m
Success!