Types of services
- Kubernetes service is an abstract way to access an application running on a set of pods.
- Set of pods targeted by a service is determined by a label selector.
- Three types of services:
1. ClusterIP:-
- This is the default service type.
- It exposes the service on a cluster internal IP.
2. NodePort:
- NodePort where the service makes an internal pod accessible on the node.
- It is the very basic way to get external traffic directly to your service.
3. LoadBalancer:
- If you create a LoadBalancer it creates a NodePort which then creates a ClusterIP.
- This will give you a single IP address that will forward all traffic to your service.
Task by trainer:-
1. Create a deployment for a super mario game.
- Deployment name = mario
- Service name = mario
- Service Type = NodePort
- Port = 8080
- Image = docker.io/pengbai/docker-supermario
2. Create a deployment for a car racing game
- Deployment name = car
- Service name = car
- Service type = NodePort
- Port = 8181
- Image = docker.io/playpalash/car-racing:01