a Service can expose multiple ports. When defining a Service with multiple ports, you must specify a unique name for each port to avoid ambiguity. This allows the Service to route traffic to different ports on the backend Pods.
B. Yes, but you must specify an unambiguous name for each port.
In Kubernetes, a Service can expose multiple ports, but you need to assign a unique name to each port to avoid ambiguity.
Multi-port Services
For some Services, you need to expose more than one port. Kubernetes lets you configure multiple port definitions on a Service object. When using multiple ports for a Service, you must give all of your ports names so that these are unambiguous. For example:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app.kubernetes.io/name: MyApp
ports:
- name: http
protocol: TCP
port: 80
targetPort: 9376
- name: https
protocol: TCP
port: 443
targetPort: 9377
B is correct:
C suggests that only different port numbers are required, but it overlooks the need for a unique name to avoid confusion and conflicts, especially when multiple ports are involved.
Therefore, B is correct because, in addition to different port numbers, a unique name for each port is required.
Isn't the correct answer C? I don't think it requires a name for each port
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
shahy0
1 week, 2 days ago2211094
1 month, 3 weeks agoabitwrong
3 months agomc2301
5 months, 1 week agomiskill
5 months, 2 weeks agomiskill
6 months agohovnival
10 months, 2 weeks agopulsefire
1 year agoomerco61
1 year ago3c9bc24
1 year, 2 months ago