Samir:
Mock Exam 2 Question: Create an nginx pod called nginx-resolver
using image nginx
, expose it internally with a service called nginx-resolver-service
. Test that you are able to look up the service and pod names from within the cluster. Use the image: busybox:1.28 for dns lookup. Record results in /root/CKA/nginx.svc
and /root/CKA/nginx.pod
What I did:
kubectl run nginx-resolver --image=nginx
kubectl expose pod nginx-resolver --name=nginx-reslolver-name --port=80
kubectl run tester --image=busybox:1.28 → error msg: Container image busybox:1.28 is already present on machine. What is wrong here?
Fernando Jimenez:
Do you have a pod running already named tester from previous runs? Please, check.
kubectl get pod tester
By the way
Container image busybox:1.28 is already present on machine
That’s not an error. That’s saying that the image busybox:1.28 is already cached in the host. The failure is afterward.
Samir:
I dont have another tester pod
Samir:
how can I clean the cache?
Samir:
and why did I receive this error?
Fernando Jimenez:
You want the cache, that’s that the reason it is failing. There must be something else.
Samir:
I did nothing more than the steps I’ve written …
Fernando Jimenez:
Did you try the lab previously?