<p>I created a kubernetes cluster in Google Cloud Platform, after that, I installed Helm/tiller on cluster, and after, I installed traefik with helm like oficial documentation says to do.</p>

<p>Now i'm trying to create an Ingress for a service, but if I put the annotation <code>kubernetes.io/ingress.class: traefik</code>, the load balancer for Ingress is not created.
But without the annotation, it works with default Ingress.
(The service type is nodeport)</p>

<p>EDIT: I also tried this example in a clean google cloud kubernetes cluster: <a href="https://supergiant.io/blog/using-traefik-as-ingress-controller-for-your-kubernetes-cluster/" rel="nofollow noreferrer">https://supergiant.io/blog/using-traefik-as-ingress-controller-for-your-kubernetes-cluster/</a> but its the same, when I chose <code>kubernetes.io/ingress.class: traefik</code>, won't be created a load balancer for ingress.</p>

<p>my files are:
<code>animals-svc.yaml:</code></p>

<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: bear
spec:
  type: NodePort
  ports:
  - name: http
    targetPort: 80
    port: 80
  selector:
    app: animals
    task: bear
---
apiVersion: v1
kind: Service
metadata:
  name: moose
spec:
  type: NodePort
  ports:
  - name: http
    targetPort: 80
    port: 80
  selector:
    app: animals
    task: moose
---
apiVersion: v1
kind: Service
metadata:
  name: hare
  annotations:
    traefik.backend.circuitbreaker: "NetworkErrorRatio() &gt; 0.5"
spec:
  type: NodePort
  ports:
  - name: http
    targetPort: 80
    port: 80
  selector:
    app: animals
    task: hare
</code></pre>

<p><code>animals-ingress.yaml:</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: animals
  annotations:
    kubernetes.io/ingress.class: traefik
    # kubernetes.io/ingress.global-static-ip-name: "my-reserved-global-ip"
    # traefik.ingress.kubernetes.io/frontend-entry-points: http
    # traefik.ingress.kubernetes.io/redirect-entry-point: http
    # traefik.ingress.kubernetes.io/redirect-permanent: "true"
spec:
  rules:
  - host: hare.minikube
    http:
      paths:
      - path: /
        backend:
          serviceName: hare
          servicePort: http
  - host: bear.minikube
    http:
      paths:
      - path: /
        backend:
          serviceName: bear
          servicePort: http
  - host: moose.minikube
    http:
      paths:
      - path: /
        backend:
          serviceName: moose
          servicePort: http
</code></pre>

<p><code>animals-deployment.yaml:</code></p>

<pre><code>---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: bear
  labels:
    app: animals
    animal: bear
spec:
  replicas: 2
  selector:
    matchLabels:
      app: animals
      task: bear
  template:
    metadata:
      labels:
        app: animals
        task: bear
        version: v0.0.1
    spec:
      containers:
      - name: bear
        image: supergiantkir/animals:bear
        ports:
        - containerPort: 80
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: moose
  labels:
    app: animals
    animal: moose
spec:
  replicas: 2
  selector:
    matchLabels:
      app: animals
      task: moose
  template:
    metadata:
      labels:
        app: animals
        task: moose
        version: v0.0.1
    spec:
      containers:
      - name: moose
        image: supergiantkir/animals:moose
        ports:
        - containerPort: 80
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: hare
  labels:
    app: animals
    animal: hare
spec:
  replicas: 2
  selector:
    matchLabels:
      app: animals
      task: hare
  template:
    metadata:
      labels:
        app: animals
        task: hare
        version: v0.0.1
    spec:
      containers:
      - name: hare
        image: supergiantkir/animals:hare
        ports:
        - containerPort: 80
</code></pre>

<p>The services are created, but the ingress loadbalancer is not created:</p>

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

<p>But, if I remove the line <code>kubernetes.io/ingress.class: traefik</code> it works with the default ingress of Kubernetes</p>

Rui Martins
<p>Traefik does not create a load balancer for you by default.</p>

<p>As <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="nofollow noreferrer">HTTP(s) load balancing with Ingress</a> documentation mention:</p>

<blockquote>
  <p>When you create an Ingress object, the GKE ingress controller creates
  a Google Cloud Platform HTTP(S) load balancer and configures it
  according to the information in the Ingress and its associated
  Services.</p>
</blockquote>

<p>This is all applicable for  GKE ingress controller(gce) - more info about gce you can find here: <a href="https://github.com/kubernetes/ingress-gce" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce</a></p>

<p>If you would like to use Traefik as ingress  - you have to  expose Traefik service with <code>type: LoadBalancer</code></p>

<p>Example:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: traefik
spec:
  type: LoadBalancer
  selector:
    k8s-app: traefik-ingress-lb
  ports:
  - port: 80
    targetPort: 80
</code></pre>

<p>More info with a lot of explanation diagrams and real working example you can find in the <a href="https://technology.amis.nl/2019/03/08/exposing-kubernetes-services-to-the-internet-using-traefik-ingress-controller/" rel="nofollow noreferrer">Exposing Kubernetes Services to the internet using Traefik Ingress Controller</a> article.</p>

<p>Hope this help.</p>
