api-ingress.yaml 3.1 KB

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