Author : MD TAREQ HASSAN | Updated : 2021/05/05

Load Balancer Type Service

Points To Be Noted

Creating Load Balancer Service

Example

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
  clusterIP: 10.0.171.239
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 192.0.2.127

Internal Load Balancer

In a mixed environment it is sometimes necessary to route traffic from Services inside the same (virtual) network address block.

To set an internal load balancer, add one of the following annotations (varies depending on the cloud Service provider)

[...]
metadata:
    name: my-service
    annotations:
        service.beta.kubernetes.io/azure-load-balancer-internal: "true"
[...]

Next