<p>I have a set of services that i want to expose as an ingress load balancer. I select nginx to be the ingress because of the ability to force http to https redirects.</p>

<p>Having an ingress config like </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: api-https
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: true
    nginx.ingress.kubernetes.io/force-ssl-redirect: true
    nginx.org/ssl-services: "api,spa"
    kubernetes.io/ingress.class: nginx
spec:
  tls:
    - hosts:
        - api.some.com
        - www.some.com
      secretName: secret
  rules:
    - host: api.some.com
      http:
        paths:
          - path: /
            backend:
              serviceName: api
              servicePort: 8080
    - host: www.some.com
      http:
        paths:
          - path: /
            backend:
              serviceName: spa
              servicePort: 8081
</code></pre>

<p>gke creates the nginx ingress load balancer but also another load balancer with backends and everything like if where not nginx selected but gcp as ingress.</p>

<p>below screenshot shows in red the two unexpected LB and in blue the two nginx ingress LB one for our qa and prod env respectively.</p>

<p><a href="https://i.stack.imgur.com/8uiT7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8uiT7.png" alt="gcplb"></a></p>

<p>output from kubectl get services</p>

<pre><code>xyz@cloudshell:~ (xyz)$ kubectl get services
NAME                            TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                         AGE
api                             NodePort       1.2.3.4         &lt;none&gt;           8080:32332/TCP,4433:31866/TCP   10d
nginx-ingress-controller        LoadBalancer   1.2.6.9         12.13.14.15      80:32321/TCP,443:32514/TCP      2d
nginx-ingress-default-backend   ClusterIP      1.2.7.10        &lt;none&gt;           80/TCP                          2d
spa                             NodePort       1.2.8.11        &lt;none&gt;           8082:31847/TCP,4435:31116/TCP   6d
</code></pre>

<p>screenshot from gcp gke services view of the ingress with wrong info</p>

<p><a href="https://i.stack.imgur.com/vz2Zz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vz2Zz.png" alt="ingress"></a></p>

<p>Is this expected? </p>

<p>Did i miss any configuration to prevent this extra load balancer for been created?</p>

bitgandtter
<p>On GCP GKE the gcp ingress controller its enabled by default and will be always lead to a new LB in any ingress definition even if the .class its specified.</p>

<p><a href="https://github.com/kubernetes/ingress-nginx/issues/3703" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/3703</a></p>

<p>So to fix it we should remove the gcp ingress controller from the cluster as mention on <a href="https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller</a></p>
