0

I installed the nginx ingress controller via the helm chart.

Now I wan't to have multiple loadbalancers, how can I scale them up?

EDIT

I don't want to scale the nginx controllers deployment. The helm chart also added the loadbalancer and I'm wondering if I can just create a new loadbalancer or if I do have to add some annotations or smth. like that?

Also would a new loadbalancer automatically forward traffic to the existing nginx-controllers?

natschz
  • 1,007
  • 10
  • 23
  • Why would you want multiple loadbalancers? A network load balancer is already pretty powerful in terms of handling millions of requests per second. Is it for redundancy in case the loadbalancer breaks somehow? How are you planning on redirecting traffic from your site to multiple loadbalancers? – George Cimpoies Jan 18 '22 at 07:37
  • As before a few weeks or months ago Digital Ocean just offered 3 types of loadbalancers. First of all we where not 100% sure if the loadbalancer was the bottleneck. Also they where kind of the only not scaling part in the kubernetes cluster. Now Digital Ocean offers loadbalancers which can dynamically scale up to one million requests per second i think. – natschz Jan 18 '22 at 09:33

1 Answers1

3

you can simply scale the Nginx deployment replicas using kubectl

kubectl scale deployment <nginx-deployment-name> --replicas=5

example

kubectl scale deployment nginx-ingress-controller -n ingress-nginx --replicas=5

EDIT

annotations you can configure and add in ingress file.

For example :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: unifonic-service-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: staging
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-body-size: "50m"
spec:
  tls:
  - hosts:
    - example.com
    secretName: staging
  rules:
  - host: example.com
    http:
      paths:
      - path: /test
        backend:
          serviceName: main-service
          servicePort: 80

if you have requirement of running multiple ingress nginx controller for managing public and internal traffic this might be helpful : https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/#multiple-ingress-nginx-controllers

https://docs.nginx.com/nginx-ingress-controller/installation/running-multiple-ingress-controllers/#running-multiple-nginx-ingress-controllers

if you want to run multiple ingress backend you can divide them by class :

 annotations:
    kubernetes.io/ingress.class: "nginx"

or

 annotations:
    kubernetes.io/ingress.class: "gce"
Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • I do not want to upgrade the nginx controllers, I really do want to upgrade the loadbalancers - see edit. – natschz Jan 28 '21 at 12:20
  • for annotation, you can append it in ingress object or file. – Harsh Manvar Jan 28 '21 at 12:37
  • Im talking about the loadbalancer not the ingress or can I just add a loadbalancer. – natschz Jan 28 '21 at 13:32
  • you can add service as load balancer but why you want to run multiple LB for single ingress controller ? – Harsh Manvar Jan 28 '21 at 14:21
  • We already have multiple ingress controllers we actually running them as DaemonSets, but I'm wondering if I just can add a new Loablancer service and if that serveris needs some labels or smth? – natschz Jan 28 '21 at 14:45
  • the annotation `kubernetes.io/ingress.class` appears now in the doc section about the deprecated annotations. Replaced by the field `ingressClassName`. Futher details: https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation – Fabio Formosa Jan 18 '22 at 14:12