boldbi / boldbi-kubernetes

Kubernetes configuration and user guide for Bold BI deployment.
https://www.boldbi.com
5 stars 5 forks source link

Bug: Incorrect nginx ingress #136

Open am-tribia opened 2 weeks ago

am-tribia commented 2 weeks ago

Incorrect nginx ingress configuration when using multiple hosts configuration for LoadBalancer

Chart version 7.9.50

loadBalancer:
  type: nginx
  affinityCookie:
    enable: true
    affinityCookieExpiration: 600
  # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
  # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
  ingressClassName: nginx
  # singleHost: 
  #   secretName: bold-tls
  multipleHost:
    hostArray:
      - hosts: 
          - kubernetes.docker.internal
          - example.com
        secretName: bold-tls

Please refer to the attached ingress.yaml file. ingress.yaml.txt

Should that be something like that following

tls:
{{- if .Values.loadBalancer.multipleHost }}
  {{- range $host := .Values.loadBalancer.multipleHost.hostArray }}
  - hosts:
    {{- range $dns := $host.hosts }}
      - {{ $dns }}
    {{- end }}
    secretName: {{ $host.secretName }}
  {{- end }}
  {{- else }}
  - hosts:
      - {{ (split "/" .Values.appBaseUrl)._2 }}
    secretName: {{ .Values.loadBalancer.singleHost.secretName }}
  {{- end }}
{{- end }}
rules:
  {{- if .Values.loadBalancer.multipleHost }}
  {{- range $host := .Values.loadBalancer.multipleHost.hostArray.hosts }}
  - host: {{ $dns }}
    http:
      paths:
      ....
  {{- end }}
  ...
am-tribia commented 2 weeks ago

@sivakumar-devops Can you check this out?

sivakumar-devops commented 2 weeks ago

Hi @am-tribia, We will check and provide an update shortly.

am-tribia commented 1 week ago

@sivakumar-devops I now tried deploying the latest fix and the hosts are correctly configured while using multipleHost. However, in our setup, we use "letsencrypt" for generating certificates for ingress controllers, and to do the same we should have the option to add the following annotation to the ingress.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod

The current helm setup doesn't allow adding custom annotations, could you please fix that as well?

sivakumar-devops commented 1 week ago

We will check the possibilities and update you shortly.