305-998-7702 | 415-800-2922 info@rx-m.com

Practice Drill

Learn how to put the latest open source technology into practice with hands-on training, delivered by industry experts, aligned to your desired business outcomes

Run the following command. This command will start a pod that will not run:

kubectl run --restart Never --image redis:0.2 redispod

Retrieve the events associated with this pod (listed in any order) and write them to a file: /tmp/troubleshooting-answer.txt

Practice Drill: Answer

First, run the command:

$ kubectl run --restart Never --image redis:0.2 redispod

pod/redispod created
$

Kubernetes reports that it successfully created the object. Now list the events in the current namespace with kubectl get events:

$ kubectl get events | grep redispod

   Normal    Scheduled   pod/redispod   Successfully assigned default/redispod to ubuntu
3s          Normal    Pulling     pod/redispod   Pulling image "redis:0.2"
2s          Warning   Failed      pod/redispod   Failed to pull image "redis:0.2": rpc error: code = Unknown desc = Error response from daemon: manifest for redis:0.2 not found: manifest unknown: manifest unknown
2s          Warning   Failed      pod/redispod   Error: ErrImagePull
16s         Normal    BackOff     pod/redispod   Back-off pulling image "redis:0.2"
16s         Warning   Failed      pod/redispod   Error: ImagePullBackOff

$

We see that the node’s container runtime could not find an image redis:0.2. As instructed, write these events to a file:

$ kubectl get events | grep redispod > /tmp/troubleshooting-answer.txt

$ cat /tmp/troubleshooting-answer.txt

   Normal    Scheduled   pod/redispod   Successfully assigned default/redispod to ubuntu
58s         Normal    Pulling     pod/redispod   Pulling image "redis:0.2"
57s         Warning   Failed      pod/redispod   Failed to pull image "redis:0.2": rpc error: code = Unknown desc = Error response from daemon: manifest for redis:0.2 not found: manifest unknown: manifest unknown
57s         Warning   Failed      pod/redispod   Error: ErrImagePull
45s         Normal    BackOff     pod/redispod   Back-off pulling image "redis:0.2"
33s         Warning   Failed      pod/redispod   Error: ImagePullBackOff

$ 

As an additional exercise, fix the redispod above using the redis:latest image.