Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm: Ingress with pathType ImplementationSpecific not working #1508

Open
cinimins opened this issue Jun 14, 2023 · 4 comments
Open

Helm: Ingress with pathType ImplementationSpecific not working #1508

cinimins opened this issue Jun 14, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers ops Need a ops update (k8s, helm, docker)

Comments

@cinimins
Copy link

cinimins commented Jun 14, 2023

Hi,

the ingress in my cluster is not working. It forwards to /ui but then outputs No server is available to handle this request.

My values.yaml looks like this (I left out tls and cert-manager annotations):

ingress:
  enabled: true
  paths:
    - /
  hotsts:
    - my.host
  annotations:
    ncp/http-redirect: "true"

When modifying the ingress to use pathType: Prefix (instead of ImplementationSpecific), it works. My default ingressclass is nsx, but it also doesn't work with nginx.

My current workaround is to deploy my own ingress instead of using the one from the helm chart. Is there a cleaner way?

@libo1987
Copy link

libo1987 commented Jun 16, 2023

Try this

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "akhq.fullname" . -}}
{{- $ingressPaths := .Values.ingress.paths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    app.kubernetes.io/name: {{ include "akhq.name" . }}
    helm.sh/chart: {{ include "akhq.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
  {{- with .Values.ingress.annotations }}
  annotations:
    {{- tpl (toYaml .) $ | nindent 4 }}
  {{- end }}
spec:
  tls:
    - hosts:
      - {{ .Values.ingress.host }}
      secretName: {{ .Values.ingress.secretName }}
  ingressClassName: nginx
  rules:
    - host: {{ .Values.ingress.host }}
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: {{ $fullName }}
              port:
                number: 8080
{{- end }}

@cinimins
Copy link
Author

cinimins commented Jun 16, 2023

Maybe the ingress controllers in our kubernetes clusters have some weird configuration, I don't know. If it's just a rare corner case, I'm fine with my own ingress, but if not, I was wondering whether it wouldn't be better to make the ingress template a bit more customizable.

The way it is currently implemented with the loop over the ingressPaths, I don't see an elegant way to make the pathType customizable.

I'm happy to make a PR, I just don't know whether anyone else has the same issue.

@tchiotludo
Copy link
Owner

@cinimins you can provide a PR for sure, just try to be non breaking compatibility

@tchiotludo tchiotludo added ops Need a ops update (k8s, helm, docker) enhancement New feature or request good first issue Good for newcomers labels Jun 27, 2023
@tchiotludo tchiotludo moved this to Backlog in Backlog Jun 29, 2023
@cinimins
Copy link
Author

cinimins commented Aug 7, 2023

I didn't find time to look at this earlier. I don't think it's possible to extend the Helm chart without breaking backward compatibility. It might be related to #664 but I couldn't get that solution to work. I think we will stick with disabling the ingress in the helm chart and deploying a separate Ingress.

Feel free to close this issue, if noone else has this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers ops Need a ops update (k8s, helm, docker)
Projects
Status: Backlog
Development

No branches or pull requests

3 participants