闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

  1. {{- if .Values.ingress.enabled -}}
  2. {{- $fullName := include "mastodon.fullname" . -}}
  3. {{- $webPort := .Values.mastodon.web.port -}}
  4. {{- $streamingPort := .Values.mastodon.streaming.port -}}
  5. {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
  6. apiVersion: networking.k8s.io/v1beta1
  7. {{- else -}}
  8. apiVersion: extensions/v1beta1
  9. {{- end }}
  10. kind: Ingress
  11. metadata:
  12. name: {{ $fullName }}
  13. labels:
  14. {{- include "mastodon.labels" . | nindent 4 }}
  15. {{- with .Values.ingress.annotations }}
  16. annotations:
  17. {{- toYaml . | nindent 4 }}
  18. {{- end }}
  19. spec:
  20. {{- if .Values.ingress.tls }}
  21. tls:
  22. {{- range .Values.ingress.tls }}
  23. - hosts:
  24. {{- range .hosts }}
  25. - {{ . | quote }}
  26. {{- end }}
  27. secretName: {{ .secretName }}
  28. {{- end }}
  29. {{- end }}
  30. rules:
  31. {{- range .Values.ingress.hosts }}
  32. - host: {{ .host | quote }}
  33. http:
  34. paths:
  35. {{- range .paths }}
  36. - path: {{ .path }}
  37. backend:
  38. serviceName: {{ $fullName }}-web
  39. servicePort: {{ $webPort }}
  40. - path: {{ .path }}api/v1/streaming
  41. backend:
  42. serviceName: {{ $fullName }}-streaming
  43. servicePort: {{ $streamingPort }}
  44. {{- end }}
  45. {{- end }}
  46. {{- end }}