ingress.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {{- if .Values.ingress.enabled -}}
  2. {{- $fullName := include "kibana.fullname" . -}}
  3. {{- $httpPort := .Values.httpPort -}}
  4. {{- $pathtype := .Values.ingress.pathtype -}}
  5. {{- $ingressPath := .Values.ingress.path -}}
  6. apiVersion: networking.k8s.io/v1
  7. kind: Ingress
  8. metadata:
  9. name: {{ $fullName }}
  10. labels: {{ include "kibana.labels" . | nindent 4 }}
  11. {{- with .Values.ingress.annotations }}
  12. annotations:
  13. {{ toYaml . | indent 4 }}
  14. {{- end }}
  15. spec:
  16. {{- if .Values.ingress.className }}
  17. ingressClassName: {{ .Values.ingress.className | quote }}
  18. {{- end }}
  19. {{- if .Values.ingress.tls }}
  20. tls:
  21. {{- if .ingressPath }}
  22. {{- range .Values.ingress.tls }}
  23. - hosts:
  24. {{- range .hosts }}
  25. - {{ . }}
  26. {{- end }}
  27. secretName: {{ .secretName }}
  28. {{- end }}
  29. {{- else }}
  30. {{ toYaml .Values.ingress.tls | indent 4 }}
  31. {{- end }}
  32. {{- end }}
  33. rules:
  34. {{- range .Values.ingress.hosts }}
  35. {{- if $ingressPath }}
  36. - host: {{ . }}
  37. http:
  38. paths:
  39. - path: {{ $ingressPath }}
  40. pathType: {{ $pathtype }}
  41. backend:
  42. service:
  43. name: {{ $fullName }}
  44. port:
  45. number: {{ $httpPort }}
  46. {{- else }}
  47. - host: {{ .host }}
  48. http:
  49. paths:
  50. {{- range .paths }}
  51. - path: {{ .path }}
  52. pathType: {{ $pathtype }}
  53. backend:
  54. service:
  55. name: {{ $fullName }}
  56. port:
  57. number: {{ .servicePort | default $httpPort }}
  58. {{- end }}
  59. {{- end }}
  60. {{- end }}
  61. {{- end }}