<p>I had found a definition, when reviewing a project, that intrigued me: the use of Ingress with a Service of type LoadBalancer without installing the load balancer itself on <a href="https://kind.sigs.k8s.io/docs/user/loadbalancer/" rel="nofollow noreferrer">Kind</a>. As defined, it seems to work but I don't know why. I say that it works because I'm able to curl the application on browser as expected.</p>
<p>Code:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: server
  labels:
    app: server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: server
  template:
    metadata:
      labels:
        app: server
    spec:
      containers:
      - name: server
        image: localhost:5000/server:2.0
---
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    app: server
  name: server
spec:
  type: LoadBalancer
  selector:
    app: server
  ports:
    - port: 8080
      targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: server
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: server
            port:
              number: 8080
</code></pre>
<p>I thought that hitting a Ingress and then the LoadBalancer would cause some redirect issue. My choice for that case would be a simple ClusterIP instead, <a href="https://stackoverflow.com/a/41565042/6328506">this</a> answer agrees. <strong>If MetalLB is not installed on the cluster, what the LoadBalancer do here?</strong> <a href="https://stackoverflow.com/a/69230856/6328506">This</a> may have a point for wanting something like that, but as far as I know, the load balancer by itself is a resource outside the cluster, i.e: a cloud provider load balancer.</p>

<blockquote>
<p>If MetalLB is not installed on the cluster, what the LoadBalancer do
here?</p>
</blockquote>
<p><strong>MetalLB</strong> is the <code>load-balancer</code> implementation for <strong>bare metal</strong> <strong>Kubernetes</strong> clusters. So MetaLB comes into the picture if you are on the baremetal or so.</p>
<p>If you are on managed could <strong>LoadBalancer</strong> will get auto-created if you will mention into <strong>YAML</strong> config without MetalLB.</p>
<blockquote>
<p>what the LoadBalancer do here?</p>
</blockquote>
<p>Since it mentioned in YAML config LoadBalancer will get created for that service.</p>
<p>Yes, you can use the <strong>ClusterIP</strong> instead of creating the <strong>LoadBalancer</strong> service. Change type and remove from the service.</p>
<p>Ideal <strong>traffic</strong> flow goes like</p>
<pre><code>Internet &gt; LoadBalancer &gt; Ingress &gt; ingress controller (Backend) &gt; service &gt; deployment &gt; Pods &gt; container
</code></pre>
<p>Yes, LB is resource of <strong>CloudProvider</strong> if you are using any managed.</p>
