jupyterlab-ingress.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {{- if and .Values.ingress.jupyterlab.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
  2. {{- if not (hasKey .Values.ingress.jupyterlab.annotations "kubernetes.io/ingress.class") }}
  3. {{- $_ := set .Values.ingress.jupyterlab.annotations "kubernetes.io/ingress.class" .Values.ingress.jupyterlab.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 }}-jupyterlab-ingress
  16. labels:
  17. tier: aihub-dag
  18. component: jupyterlab
  19. release: {{ .Release.Name }}
  20. {{- with .Values.ingress.jupyterlab.annotations }}
  21. annotations:
  22. {{- toYaml . | nindent 4 }}
  23. {{- end }}
  24. spec:
  25. {{- if and .Values.ingress.jupyterlab.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
  26. ingressClassName: {{ .Values.ingress.jupyterlab.className }}
  27. {{- end }}
  28. rules:
  29. {{- range .Values.ingress.jupyterlab.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 }}-jupyterlab
  42. port:
  43. name: jupyterlab-port
  44. {{- else }}
  45. serviceName: {{ $.Release.Name }}-jupyterlab
  46. servicePort: jupyterlab-port
  47. {{- end }}
  48. {{- end }}
  49. {{- end }}