ingress.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{- range $name, $component := .Values.ingresses }}
  2. {{- if $component.enabled -}}
  3. ---
  4. apiVersion: networking.k8s.io/v1
  5. kind: Ingress
  6. metadata:
  7. name: {{ include "chart.componentFullname" (dict "root" $ "name" $name) }}
  8. labels:
  9. {{- include "chart.componentLabels" (dict "root" $ "name" $name) | nindent 4 }}
  10. {{- with $component.annotations }}
  11. annotations:
  12. {{- toYaml . | nindent 4 }}
  13. {{- end }}
  14. spec:
  15. {{- with $component.className }}
  16. ingressClassName: {{ . }}
  17. {{- end }}
  18. {{- if $component.tls }}
  19. tls:
  20. {{- range $component.tls }}
  21. - hosts:
  22. {{- range .hosts }}
  23. - {{ . | quote }}
  24. {{- end }}
  25. secretName: {{ .secretName }}
  26. {{- end }}
  27. {{- end }}
  28. rules:
  29. {{- range $component.hosts }}
  30. -
  31. {{- with .host }}
  32. host: {{ . | quote }}
  33. {{- end }}
  34. http:
  35. paths:
  36. {{- range .paths }}
  37. - path: {{ .path }}
  38. {{- with .pathType }}
  39. pathType: {{ . }}
  40. {{- end }}
  41. backend:
  42. service:
  43. name: {{ include "chart.componentFullname" (dict "root" $ "name" .component) }}
  44. port:
  45. number: {{ index $.Values.components .component "service" "port" }}
  46. {{- end }}
  47. {{- end }}
  48. {{- end }}
  49. {{- end }}