Service Configuration
medium

Questão de Service Configuration #019e3a4f

Enunciado da Questão
Service Configuration
#kubernetes
#service
#ports
#networking
Médio

Can a Kubernetes Service expose multiple ports?

A

No, you can only expose one port per each Service.

B

Yes, but you must specify an unambiguous name for each port.

Correta
C

Yes, the only requirement is to use different port numbers.

D

No, because the only port you can expose is port number 443.

Explicação Oficial / Explicações da Comunidade

A Kubernetes Service can expose multiple ports. When doing so, each port must have an unambiguous name specified. This is required because the Service's port names are used for traffic routing and must be unique within the Service. The name is used by endpoints and ingress controllers to differentiate between ports. For example, a Service might expose port 80 for HTTP and port 443 for HTTPS, with names like http and https. The port numbers can be the same or different, but the names must be unique. The incorrect options: 'No, you can only expose one port per each Service' is false because Kubernetes Services support multiple ports. 'Yes, the only requirement is to use different port numbers' is false because port numbers can be the same if the protocol differs (e.g., TCP and UDP), but names are mandatory. 'No, because the only port you can expose is port number 443' is false because Services can expose any port, not just 443.