A Kubernetes Service can expose multiple ports, and this is commonly used when:
An application exposes multiple protocols (e.g., HTTP and gRPC)
Different components need to be accessed on different ports (e.g., HTTP on 80, metrics on 8080)
However, if multiple ports are defined, each port must have a unique name — especially when using protocols like HTTP/2 or gRPC, which rely on port names to route correctly (e.g., in service meshes like Istio or Linkerd).
A. No, you can only expose one port per each Service:
❌ Incorrect — Services can expose multiple ports.
C. Yes, the only requirement is to use different port numbers:
❌ Partially correct — different ports are required, but naming is also required for disambiguation.
D. No, because the only port you can expose is port number 443:
❌ False — Services can expose any valid port number, not just 443.
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
...
This section is not available anymore. Please use the main Exam Page.KCNA Exam Questions
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.
donathon
1 month agoMatsuura
2 months, 3 weeks agoshahy0
3 months, 3 weeks ago2211094
5 months, 1 week agoabitwrong
6 months, 2 weeks agomc2301
8 months, 3 weeks agomiskill
9 months agomiskill
9 months, 2 weeks agohovnival
1 year, 2 months agopulsefire
1 year, 3 months agoomerco61
1 year, 4 months ago3c9bc24
1 year, 5 months ago