Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.15 KB

service.md

File metadata and controls

31 lines (19 loc) · 1.15 KB

Kubernetes Service object

Default port range: 30000-32767

Presentation

A Service is an "abstract way to expose an application running on a set of Pods as a network service".

Services are flexible and scalable agents which connect resources together and will reconnect, should something die and a replacement is spawned. Each Service is a microservice handling a particular bit of traffic, such as a single NodePort or a LoadBalancer to distribute inbound requests among many Pods.

A Service also handles access policies for inbound requests, useful for resource control, as well as for security.

Service types:

  • NodePort
  • ClusterIP
  • LoadBalancer

Command line examples

# get all services
kubectl get svc

# create a service redis-service to expose the redis application (pod) within the cluster on port 6379
k expose pod redis --port=6379 --name=redis-service

Going further