Kubernetes for the Absolute Beginners - Hands-on | Udemy
Services enable loose coupling between microservice Kubernetes setups.
- It forwards requests to a port to another port
Types of services:
- NodePort: internal port accessible to external port
- ClusterIP: virtual IP inside a cluster to connect applications
- LoadBalancer: distribute work among different pods
NodePort
NodePort consists of 3 ports where they are connected all together
- TargetPort: port of the pod
- Port: port of the service
- NodePort: port of the node
To link the service to the pod, the section under the “label” of the pod must go under the selector section of the service definition file.
kubectl get services: get a list of services in Kubernetes
A random algorithm balances the request load when multiple pods of the same label are assigned to the service.
- when the pods are distributed across different nodes, Kubernetes automatically configures service for all the nodes
ClusterIP
Services can be created for each application so that Kubernetes will configure which pod of the service will be connected to another pod of other services.
- This way, the user does not have to configure for IP address of each pod
- Effective for microservices
LoadBalancer
Setting the service type as LoadBalancer automatically configures one external IP/domain for the end user to easily access cloud services like GCP, Azure, and AWS.
- instead of having 4 URLs for each of the pods, a single load balancer can give the user access to a single URL.
'DevOps > Kubernetes' 카테고리의 다른 글
[Kubernetes 배우기] Section 9. Kubernetes on Cloud (0) | 2024.01.09 |
---|---|
[Kubernetes 배우기] Section 8. Microservices Architecture (0) | 2024.01.09 |
[Kubernetes 배우기] Section 6. Networking in Kubernetes (0) | 2024.01.09 |
[Kubernetes 배우기] Section 5. Kubernetes Concepts - Pods, ReplicaSets, Deployments (1) | 2024.01.09 |
[Kubernetes 배우기] Section 4. YAML Introduction (0) | 2024.01.09 |