July 2018
Intermediate to advanced
574 pages
14h 7m
English
In this section, we'll create a Kubernetes service, which will be responsible for exposing the pods we've just created. A service routes the requests to specific pods based on the label values of the selector section:
$ cat deploy/elixir-drip-loadbalancer-prod.yml apiVersion: v1kind: Servicemetadata: name: elixir-drip-loadbalancer namespace: production env: productionspec: type: LoadBalancer selector: app: elixir-drip env: production
ports: - port: 80 targetPort: 4000
We are routing requests arriving through port 80 of the load-balancer to port 4000 of a pod with the app=elixir-drip and env=production labels. Creating a LoadBalancer service like ours exposes the service using a load balancer from the cloud ...
Read now
Unlock full access