Kubernetes Service, Load Balancing, and Networking :
Services :- Services
- DNS for Services and Pods
- Connecting Application with Services
- Ingress
- Network Policies
- Adding entries to Pod/etc/hosts with HostAliases
It can be defined as an abstraction on the top of the pod which provides a single IP address and DNS name by which pods can be accessed.
With Service, it is very easy to manage load balancing configuration . It helps pods to scale very easily.
The set of pods targeted by a Service is (usually) determined by a label selector .
A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service.
- Defining a service
- Virtual IPs and service proxies
- Multi-Port Services
- Choosing your own IP address
- Discovering service
- Headless services
- Publishing services - service types
- Shortcomings
- Future work
- The gory details of virtual IPs
- API Object
- SCTP support
A Service in Kubernetes is a REST object, similar to a Pod. Like all of the REST objects, Service definition can be POSsted to the apiserver to create a new instance.
For Example :
Service with Selector -
kind: Service
apiVersion: V1
metadata:
name: my-service
spec:
Selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
Services without selectors:
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
ports:
-protocol: TCP
port: 80
targetPort: 9376
Because this service has n0 selector, the corresponding Endpoints object will not be created. You can manually map the service to your own specific endpoints:
kind: Endpoints
apiVersion: v1
metadata:
name: my-service
subsets:
- addresses:
- ip: 1.2.3.4
ports:
- port: 9376
No comments:
Post a Comment