10.5. Exposing a virtual machine by using a service
You can expose a virtual machine (VM) within or outside the cluster by exposing a VM as a Kubernetes service. You can leverage native load balancing and observability tools that provide unified traffic management, consistent SSL termination, and centralized security policies across hybrid workloads.
10.5.1. About services 링크 복사링크가 클립보드에 복사되었습니다!
A Kubernetes service exposes network access for clients to an application running on a set of pods. Services offer abstraction, load balancing, and, in the case of the NodePort and LoadBalancer types, exposure to the outside world.
ClusterIP-
Exposes the service on an internal IP address and as a DNS name to other applications within the cluster. A single service can map to multiple virtual machines. When a client tries to connect to the service, the client’s request is load balanced among available backends.
ClusterIPis the default service type. NodePort-
Exposes the service on the same port of each selected node in the cluster.
NodePortmakes a port accessible from outside the cluster, provided that the node itself is externally accessible to the client. LoadBalancer- Creates an external load balancer in the current cloud (if supported) and assigns a fixed, external IP address to the service.
For on-premise clusters, you can configure a load balancing service by deploying the MetalLB Operator.