Gradiant / 5g-charts

Helm charts for 5G Technologies
Apache License 2.0
108 stars 42 forks source link

ingressClassName not used in webui ingress template #140

Closed anabel1012 closed 7 months ago

anabel1012 commented 8 months ago

Hello! I was trying to configure the ingress service for webui as nginx type. I have seen that the variable ingressClassName is defined in the values.yaml of webui/templates but then it is not used in webui/templates/ingress.yaml.

Correct me if I'm wrong, but I think there is a line missing in the charts/open5gs-webui/templates/ingress.yaml file.

spec:
  ingressClassName: ... (to add)
  rules:
    - host: {{ .Values.ingress.hostname | default (printf "%s-%s.ingress.lab5g.gradiant.org" .Release.Name .Release.Namespace) }}

If not, please, could you help me with this ingress type nginx?

Thanks, Anabel

cgiraldo commented 8 months ago

You are right. The ingressclassName is missing.

The open5gs-webui ingress template should include this block:

spec:
{{- if and .Values.ingress.ingressClassName (semverCompare ">=1.19-0" $kubeVersion) }}
  ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
  rules:

I invite you to make a Pull Request and contribute this change.

Please, if you do so, also increase the patch version of the open5gs-webui chart from 2.1.0 to 2.1.1 in https://github.com/Gradiant/openverso-charts/blob/master/charts/open5gs-webui/Chart.yaml

anabel1012 commented 8 months ago

Thank you for the quick answer!

I have done a test before making the Pull Request and I have found this error:

Error: INSTALLATION FAILED: parse error at (open5gs/charts/webui/templates/ingress.yaml:12): undefined variable "$kubeVersion"

Looking for similar lines where kubeVersion appears, could it be this the correct block?

spec:
  {{- if and .Values.ingress.ingressClassName (semverCompare ">=1.19-0" (include "common.capabilities.kubeVersion" .)) }}
  ingressClassName: {{ .Values.ingress.ingressClassName }}
  {{- end }}
  rules:
cgiraldo commented 8 months ago

Sorry, I copy the block from the jitsi chart and miss the kubeVersion variable definition.

Check it here:

https://github.com/Gradiant/openverso-charts/blob/fe676f2a30606c2ce51525897f89f625d299af1a/charts/jitsi/templates/ingress.yaml#L4C1-L4C61