Kubernetes Services
Contents
What is the Services in the Kubernetes?
The Services are ways to communicate users to frontend, frontend to backend, and backend to extra datasource.
The Services enable loose coupling in between microservices in application.
The Services are in the labels
/selector
matched Nodes and so you can access to the Nodes with configured Port.
The Service that is in the Node can access labels
/selector
matched PODs with the configured Port in the Node.
Services Types
NodePort
The Service makes POD access to other PODs on the Node.
ClusterIP
The Service create virtual IP inside cluster to enable communication between difference services such as frontend server
to backend server.
The cluster is a group of PODs that are created by same configuration(YAML or commands, replicas).
The cluster is a group of PODs that are created by same configuration(YAML or commands, replicas).
LoadBalancer
Support Load Balance in Application.
NodePort
TargetPort
The Target is the POD.
The TargetPort is a port of the POD.
The POD is in the Node.
The Service Target Port.
The TargetPort is a port of the POD.
The POD is in the Node.
The Service Target Port.
Port
The Service is in the Node.
The Service’s port to go to the target port.
The Service’s port to go to the target port.
NodePort
The NodePort is a port of the Node.
The ranges are 30000-32767.
The ranges are 30000-32767.
YAML
pod-definition.yml
|
|
service-definition.yml
|
|
Commands
Create a Service
|
|
Show Service List
|
|
ClusterIP
YAML
pod-definition.yml
|
|
service-definition.yml
|
|
Commands
Create a Service
|
|
Show Service List
|
|
LoadBalancer
YAML
pod-definition.yml
|
|
service-definition.yml
|
|
Commands
Create a Service
|
|
Show Service List
|
|
Commands
Show Service List
|
|
Show Service Detail
|
|