minio-api-ingress.yanl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {{- if and .Values.ingress.minioapi.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
  2. {{- if not (hasKey .Values.ingress.minioapi.annotations "kubernetes.io/ingress.class") }}
  3. {{- $_ := set .Values.ingress.minioapi.annotations "kubernetes.io/ingress.class" .Values.ingress.minioapi.className}}
  4. {{- end }}
  5. {{- end }}
  6. {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
  7. apiVersion: networking.k8s.io/v1
  8. {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
  9. apiVersion: networking.k8s.io/v1beta1
  10. {{- else -}}
  11. apiVersion: extensions/v1beta1
  12. {{- end }}
  13. kind: Ingress
  14. metadata:
  15. name: {{ .Release.Name }}-minioapi-ingress
  16. labels:
  17. tier: aihub-dag
  18. component: minioapi
  19. release: {{ .Release.Name }}
  20. {{- with .Values.ingress.minioapi.annotations }}
  21. annotations:
  22. {{- toYaml . | nindent 4 }}
  23. {{- end }}
  24. spec:
  25. {{- if and .Values.ingress.minioapi.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
  26. ingressClassName: {{ .Values.ingress.minioapi.className }}
  27. {{- end }}
  28. rules:
  29. {{- range .Values.ingress.minioapi.hosts }}
  30. - host: {{ .host | quote }}
  31. http:
  32. paths:
  33. {{- range .paths }}
  34. - path: {{ .path }}
  35. {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
  36. pathType: {{ .pathType }}
  37. {{- end }}
  38. backend:
  39. {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
  40. service:
  41. name: {{ $.Release.Name }}-minio
  42. port:
  43. name: api-port
  44. {{- else }}
  45. serviceName: {{ $.Release.Name }}-minio
  46. servicePort: api-port
  47. {{- end }}
  48. {{- end }}
  49. {{- end }}