Load Balancer in Kubernetes

I have installed kubernetes using minikube on a single node. I have implemented ‘LoadBalancer’ type of service which manages 3 pods. By default, it uses a ‘network load balancer’. Can we change load balancer type in service .yaml file or can we change load balancer algorithm used? please find the service file below :

— myservice.yaml

apiVersion: v1
kind: Service
metadata:
name: demo-apps-lb
spec:
type: LoadBalancer
ports:

  • port: 80
    selector:
    app: app1

If your load-balancer implementation supports parameters like that, you can use custom annotations on the Service to pass that down. Not every LB supports them, so there are not standard fields for it.

Thanks for your reply!!!

I am not clear on load balancer implementation, is it with respect to cloud platform(e.g: aws, gcp, etc)?

Here I am not using any cloud platform, all the things are local on my single machine.

Yes, they are cloud.

You can use MetalLB on such locals setups, though.

Thank You for the information!