|
| 1 | +{{- if .Values.django.httpRoute.enabled -}} |
| 2 | +{{- $fullName := include "defectdojo.fullname" . -}} |
| 3 | +apiVersion: gateway.networking.k8s.io/v1 |
| 4 | +kind: HTTPRoute |
| 5 | +metadata: |
| 6 | + {{- if or .Values.extraAnnotations .Values.django.httpRoute.annotations }} |
| 7 | + annotations: |
| 8 | + {{- range $key, $value := .Values.extraAnnotations }} |
| 9 | + {{ $key }}: {{ quote $value }} |
| 10 | + {{- end }} |
| 11 | + {{- range $key, $value := .Values.django.httpRoute.annotations }} |
| 12 | + {{ $key }}: {{ quote $value }} |
| 13 | + {{- end }} |
| 14 | + {{- end }} |
| 15 | + labels: |
| 16 | + defectdojo.org/component: django |
| 17 | + app.kubernetes.io/name: {{ include "defectdojo.name" . }} |
| 18 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 19 | + app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 20 | + helm.sh/chart: {{ include "defectdojo.chart" . }} |
| 21 | + {{- range $key, $value := .Values.extraLabels }} |
| 22 | + {{ $key }}: {{ quote $value }} |
| 23 | + {{- end }} |
| 24 | + name: {{ $fullName }} |
| 25 | + namespace: {{ .Release.Namespace }} |
| 26 | +spec: |
| 27 | + parentRefs: |
| 28 | + {{- range .Values.django.httpRoute.parentRefs }} |
| 29 | + - group: {{ .group | default "gateway.networking.k8s.io" }} |
| 30 | + kind: {{ .kind | default "Gateway" }} |
| 31 | + name: {{ .name }} |
| 32 | + {{- if .namespace }} |
| 33 | + namespace: {{ .namespace }} |
| 34 | + {{- end }} |
| 35 | + {{- if .sectionName }} |
| 36 | + sectionName: {{ .sectionName }} |
| 37 | + {{- end }} |
| 38 | + {{- end }} |
| 39 | + hostnames: |
| 40 | + - {{ .Values.host | quote }} |
| 41 | + rules: |
| 42 | + - matches: |
| 43 | + - path: |
| 44 | + type: PathPrefix |
| 45 | + {{- if .Values.django.httpRoute.path }} |
| 46 | + value: {{ .Values.django.httpRoute.path }} |
| 47 | + {{- else }} |
| 48 | + value: "/" |
| 49 | + {{- end }} |
| 50 | + backendRefs: |
| 51 | + - name: {{ $fullName }}-django |
| 52 | + port: {{ .Values.django.nginx.tls.enabled | ternary 443 80 }} |
| 53 | +{{- end }} |
0 commit comments