ingress.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {{- if .Values.ingress.enabled }}
  2. apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
  3. kind: Ingress
  4. metadata:
  5. name: {{ include "common.names.fullname" . }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. {{- if .Values.commonLabels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. annotations:
  12. {{- if .Values.ingress.annotations }}
  13. {{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
  14. {{- end }}
  15. {{- if .Values.commonAnnotations }}
  16. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  17. {{- end }}
  18. spec:
  19. {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
  20. ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
  21. {{- end }}
  22. rules:
  23. {{- if .Values.ingress.hostname }}
  24. - host: {{ .Values.ingress.hostname | quote }}
  25. http:
  26. paths:
  27. {{- if .Values.ingress.extraPaths }}
  28. {{- toYaml .Values.ingress.extraPaths | nindent 10 }}
  29. {{- end }}
  30. - path: {{ .Values.ingress.path }}
  31. {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
  32. pathType: {{ .Values.ingress.pathType }}
  33. {{- end }}
  34. backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }}
  35. {{- end }}
  36. {{- range .Values.ingress.extraHosts }}
  37. - host: {{ .name | quote }}
  38. http:
  39. paths:
  40. - path: {{ default "/" .path }}
  41. {{- if eq "true" (include "common.ingress.supportsPathType" $) }}
  42. pathType: {{ default "ImplementationSpecific" .pathType }}
  43. {{- end }}
  44. backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
  45. {{- end }}
  46. {{- if .Values.ingress.extraRules }}
  47. {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
  48. {{- end }}
  49. {{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned)) .Values.ingress.extraTls }}
  50. tls:
  51. {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
  52. - hosts:
  53. - {{ .Values.ingress.hostname | quote }}
  54. secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
  55. {{- end }}
  56. {{- if .Values.ingress.extraTls }}
  57. {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
  58. {{- end }}
  59. {{- end }}
  60. {{- end }}