Service Configuration
medium
Pregunta de Service Configuration #019e3a4f
Enunciado de la Pregunta
Service Configuration
#kubernetes
#service types
#networking
Medio
How many different Kubernetes service types can you define?
A
2
B
3
C
4
Correcto
D
5
Explicación Oficial / Explicaciones de la Comunidad
Kubernetes defines four distinct service types: ClusterIP, NodePort, LoadBalancer, and ExternalName.
How it Works
- ClusterIP: Exposes the service on a cluster-internal IP. This is the default type and makes the service only reachable from within the cluster.
- NodePort: Exposes the service on each Node’s IP at a static port (the NodePort). A ClusterIP service, to which the NodePort service routes, is automatically created. You can contact the NodePort service from outside the cluster by requesting
<NodeIP>:<NodePort>. - LoadBalancer: Exposes the service externally using a cloud provider’s load balancer. NodePort and ClusterIP services are automatically created, to which the external load balancer routes.
- ExternalName: Maps the service to the contents of the
externalNamefield (e.g.,foo.bar.example.com) by returning a CNAME record with its value. No proxying of any kind is set up.
Why the correct answer is 4
The Kubernetes API documentation and official tutorials list exactly these four service types. The value 4 is correct because it accounts for all standard types.
Why the incorrect values are wrong
- The value 2 is incorrect because it omits at least two of the standard types (e.g., LoadBalancer and ExternalName).
- The value 3 is incorrect because it omits one of the four types, typically ExternalName.
- The value 5 is incorrect because there is no fifth standard service type. While custom resource definitions or extensions could add more, the question asks about the number of different Kubernetes service types you can define, which refers to the built-in types.