<p>I have a custom kubernetes cluster on a serve with public IP and DNS pointing to it (also wildcard).
Gitlab was configured with the cluster following this guide: <a href="https://gitlab.touch4it.com/help/user/project/clusters/index#add-existing-kubernetes-cluster" rel="nofollow noreferrer">https://gitlab.touch4it.com/help/user/project/clusters/index#add-existing-kubernetes-cluster</a></p>

<p>However, after installing <code>Ingress</code>, the ingress endpoint is never detected:</p>

<p><a href="https://i.stack.imgur.com/gwuij.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gwuij.png" alt="enter image description here"></a></p>

<p>I tried patching the object in k8s, like so </p>

<pre><code>externalIPs: (was empty)
 - 1.2.3.4
externalTrafficPolicy: local (was cluster)
</code></pre>

<p>I suspect that the problem is empty ingress (scroll to the end) object then calling:</p>

<pre><code># kubectl get service ingress-nginx-ingress-controller -n gitlab-managed-apps -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2019-11-20T08:57:18Z"
  labels:
    app: nginx-ingress
    chart: nginx-ingress-1.22.1
    component: controller
    heritage: Tiller
    release: ingress
  name: ingress-nginx-ingress-controller
  namespace: gitlab-managed-apps
  resourceVersion: "3940"
  selfLink: /api/v1/namespaces/gitlab-managed-apps/services/ingress-nginx-ingress-controller
  uid: c175afcc-0b73-11ea-91ec-5254008dd01b
spec:
  clusterIP: 10.107.35.248
  externalIPs:
  - 1.2.3.4 # (public IP)
  externalTrafficPolicy: Local
  healthCheckNodePort: 30737
  ports:
  - name: http
    nodePort: 31972
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 31746
    port: 443
    protocol: TCP
    targetPort: https
  selector:
    app: nginx-ingress
    component: controller
    release: ingress
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer: {}
</code></pre>

<p>But Gitlab still cant find the ingress endpoint. I tried restarting cluster and Gitlab.
The network inspection in Gitlab always shows this response:</p>

<pre><code>...
name    ingress
status  installed
status_reason   null
version 1.22.1
external_ip null
external_hostname   null
update_available    false
can_uninstall   false
...
</code></pre>

<p>Any ideas how to have a working Ingress Endpoint?</p>

<p>GitLab: 12.4.3 (4d477238500) k8s: 1.16.3-00</p>

Horkyze
<p>I had the exact same issue as you, and I finally figured out how to solve it.</p>
<p>The first to understand, is that on bare metal, you can't make it working without using MetalLB, because it calls the required Kubernetes APIs making it accepting the IP address you give to the <code>Service</code> of <code>LoadBalancer</code> type.</p>
<p>So first step is to <a href="https://metallb.universe.tf/installation/" rel="nofollow noreferrer">deploy MetalLB</a> to your cluster.</p>
<p>Then you need to have another machine, running a service like NGiNX or HAproxy or whatever can do some load balancing.</p>
<p>Last but not least, you have to give the Load Balancer machine IP address to MetalLB so that it can assign it to the <code>Service</code>.
Usually MetalLB requires a range of IP addresses, but you can also give one IP address like I did:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: staging-public-ips
      protocol: layer2
      addresses:
      - 1.2.3.4/32
</code></pre>
<p>This way, MetalLB will assign the IP address to the <code>Service</code> with type <code>LoadBalancer</code> and Gitlab will finally find the IP address.</p>
<p><strong>WARNING:</strong> MetalLB will assign <strong>only once</strong> an IP address. If you need many <code>Service</code> with type <code>LoadBalancer</code>, you will need many machines running NGiNX/HAproxy and so on and add its IP address in the MetalLB <code>addresses</code> pool.</p>
<p>For your information, I've posted all the technical details to <a href="https://gitlab.com/gitlab-org/gitlab/-/issues/324062" rel="nofollow noreferrer">my Gitlab issue here</a>.</p>
