1

I have an EKS cluster. We want - One LB that will redirect to multiple namespace inside the cluster, - Ingress to avoid the "one load balancer for one service". I want to cut it by namespace.

I have been reading a bit of documentation but I can't seem to wrap my head around it. I have this yaml, which I understood would create a LB and the ingress rules.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: simple-fanout-example
  namespace : default
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: domain.com
    http:
      paths:
      - path: /blabla
        backend:
          serviceName: blabla
          servicePort: 8000
      - path: /bleble
        backend:
          serviceName: bleble
          servicePort: 8000

This create successfully the ingress but... Nothing else happens?

I'm unsure what I'm missing, would really appreciate some help. Thamks!

shrimpy
  • 653
  • 3
  • 11
  • 27

1 Answers1

0

This would not create a LB. Ingress is just a routing rule for your ingress controller. Think of it like a location block in your nginx config. A K8S Service with Load Balancer type would create a LB in AWS.

You could get more understanding from my other answer here: AWS VPC - k8s - load balancing

Fei
  • 1,906
  • 20
  • 36
  • Hello! I took this from this source: https://itnext.io/save-on-your-aws-bill-with-kubernetes-ingress-148214a79dcb They then say: "And voila! There is nothing more to do. The NGINX Ingress controller will process those resources and automatically create a single ELB." – shrimpy Jun 05 '19 at 11:19
  • and I have tried creating a load balancer without a labelselector (as they represent my service?), but it doesn't seem to work? See: https://stackoverflow.com/questions/56444546/kubernetes-load-balancer-without-label-selector – shrimpy Jun 05 '19 at 11:20
  • I went through your reference. You missed the very first step, which is to install a Nginx-Ingress-Controller. You would need to have the Ingress-Controller installed to have your ingress config working. In your other question in SO, you would need to specify your nginx-ingress-controller as selected back-end for your LB Service. – Fei Jun 05 '19 at 11:28
  • Let me write an answer to your other question in stackoverflow. I don't think you explain yourself clearly. But I would suggest you go through the linked answer I wrote in my answer for understanding. – Fei Jun 05 '19 at 11:31