ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 169 - DCA discussion

Report
Export

The Kubernetes yaml shown below describes a clusterIP service.

Is this a correct statement about how this service routes requests?

Solution: Traffic sent to the IP of this service on port 80 will be routed to port 8080 in a random pod with the label app:

nginx.

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

The statement is not entirely correct. In Kubernetes, a service of type ClusterIP routes traffic sent to its IP address to the pods selected by its label selector1. However, the port to which the traffic is routed in the pod is determined by the targetPort specified in the service definition1. If targetPort is not specified, it defaults to being the same as the port field1. In the provided YAML snippet, there is no targetPort specified for port 80, so we cannot confirm that the traffic will be routed to port 8080 in the pod. Therefore, without additional information about the pod configuration, we cannot verify the provided solution statement1.

asked 08/11/2024
Emmanuel Esquivel Guzman
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first