I have a question on the Kubernetes Training Course Mock Exam 1 Question 19. After updating the port from 8080 to 80 and running “k logs purple-curl-cka27-trb” I am not getting the output “Thank you for using nginx”.
Here the issue is knowing the difference between the “port” and the “targetPort” or the service. “port” is the port you use to access the service. “targetPort” is the containPort on the pod the service is accessing. Here, you need to fix the targetPort, since without changing the nginx container’s config files, nginx listens on port 80.