|
1 | 1 | {{- define "deploy_utils.ingress.http" }} |
2 | 2 | {{ $domain := .root.Values.domain }} |
3 | 3 | {{ $secured_gatekeepers := and .root.Values.secured_gatekeepers }} |
| 4 | + {{ $app := .app }} |
4 | 5 | http: |
5 | 6 | paths: |
| 7 | +{{- if and $app.harness.secured $secured_gatekeepers $app.harness.uri_role_mapping }} |
| 8 | + {{- range $mapping := $app.harness.uri_role_mapping }} |
| 9 | + {{- if and (hasKey $mapping "white-listed") (index $mapping "white-listed") }} |
| 10 | + {{- $uri := $mapping.uri }} |
| 11 | + {{- if eq $uri "/" }} |
| 12 | + - path: /() |
| 13 | + pathType: ImplementationSpecific |
| 14 | + backend: |
| 15 | + service: |
| 16 | + name: {{ $app.harness.service.name | quote }} |
| 17 | + port: |
| 18 | + number: {{ $app.harness.service.port | default 80 }} |
| 19 | + {{- else if hasSuffix "/*" $uri }} |
| 20 | + {{- $cleanPath := trimSuffix "/*" $uri }} |
| 21 | + {{- $pathWithoutSlash := trimPrefix "/" $cleanPath }} |
| 22 | + - path: {{ printf "/(%s/.*)" $pathWithoutSlash }} |
| 23 | + pathType: ImplementationSpecific |
| 24 | + backend: |
| 25 | + service: |
| 26 | + name: {{ $app.harness.service.name | quote }} |
| 27 | + port: |
| 28 | + number: {{ $app.harness.service.port | default 80 }} |
| 29 | + {{- else if not (contains "*" $uri) }} |
| 30 | + {{- $pathWithoutSlash := trimPrefix "/" $uri }} |
| 31 | + - path: {{ printf "/(%s)" $pathWithoutSlash }} |
| 32 | + pathType: ImplementationSpecific |
| 33 | + backend: |
| 34 | + service: |
| 35 | + name: {{ $app.harness.service.name | quote }} |
| 36 | + port: |
| 37 | + number: {{ $app.harness.service.port | default 80 }} |
| 38 | + {{- end }} |
| 39 | + {{- end }} |
| 40 | + {{- end }} |
| 41 | +{{- end }} |
6 | 42 | - path: /(.*) |
7 | 43 | pathType: ImplementationSpecific |
8 | 44 | backend: |
9 | 45 | service: |
10 | | - name: {{ if (and .app.harness.secured $secured_gatekeepers) }}{{ printf "%s-gk" .subdomain }}{{ else }}{{ .app.harness.service.name | quote }}{{ end }} |
| 46 | + name: {{ if (and $app.harness.secured $secured_gatekeepers) }}{{ printf "%s-gk" .subdomain }}{{ else }}{{ $app.harness.service.name | quote }}{{ end }} |
11 | 47 | port: |
12 | | - number: {{- if (and .app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ .app.harness.service.port | default 80 }}{{- end }} |
| 48 | + number: {{- if (and $app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ $app.harness.service.port | default 80 }}{{- end }} |
| 49 | + |
13 | 50 | {{- end }} |
14 | 51 | {{- define "deploy_utils.ingress.service" }} |
15 | 52 | {{ $domain := .root.Values.domain }} |
@@ -40,6 +77,9 @@ metadata: |
40 | 77 | nginx.ingress.kubernetes.io/ssl-redirect: {{ (and $tls .Values.ingress.ssl_redirect) | quote }} |
41 | 78 | nginx.ingress.kubernetes.io/proxy-body-size: '{{ .Values.proxy.payload.max }}m' |
42 | 79 | nginx.ingress.kubernetes.io/proxy-buffer-size: '128k' |
| 80 | + nginx.ingress.kubernetes.io/proxy-buffering: "on" |
| 81 | + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" |
| 82 | + nginx.ingress.kubernetes.io/proxy-max-temp-file-size: "1024m" |
43 | 83 | nginx.ingress.kubernetes.io/from-to-www-redirect: 'true' |
44 | 84 | nginx.ingress.kubernetes.io/rewrite-target: /$1 |
45 | 85 | nginx.ingress.kubernetes.io/auth-keepalive-timeout: {{ .Values.proxy.timeout.keepalive | quote }} |
|
0 commit comments