ingress.yaml 1.6 KB

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