-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathinstances-ingress-path-based.yaml
More file actions
65 lines (65 loc) · 2.38 KB
/
instances-ingress-path-based.yaml
File metadata and controls
65 lines (65 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{- if .Values.hosts.usePaths }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ tpl (.Values.ingress.instanceName | toString) . }}
namespace: {{ .Release.Namespace }}
annotations:
{{- if not .Values.hosts.tls }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
{{- end }}
nginx.ingress.kubernetes.io/proxy-buffer-size: "128k"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header 'X-Forwarded-Uri' $request_uri;
nginx.ingress.kubernetes.io/proxy-body-size: {{ tpl (.Values.ingress.proxyBodySize | toString) . }}
{{- if .Values.hosts.paths.tlsSecretName }}
{{- if .Values.ingress.certManagerAnnotations }}
cert-manager.io/cluster-issuer: {{ tpl (.Values.ingress.clusterIssuer | toString) . }}
{{- if .Values.ingress.theiaCloudCommonName }}
cert-manager.io/common-name: "Theia.Cloud"
{{- end }}
acme.cert-manager.io/http01-ingress-class: nginx
{{- end }}
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.hosts.tls }}
tls:
- hosts:
- {{ tpl (.Values.hosts.paths.baseHost | toString) . }}
{{- range .Values.hosts.additionalWildcardInstances }}
- {{ printf "'%s%s'" . $.Values.hosts.paths.baseHost }}
{{- end }}
{{- if .Values.hosts.paths.tlsSecretName }}
secretName: ws-cert-secret
{{- end }}
{{- end }}
{{- if not (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .) ) }}
rules:
- host: {{ tpl (.Values.hosts.paths.baseHost | toString) . }}
http:
{{- range .Values.hosts.additionalWildcardInstances }}
- host: {{ printf "'%s%s'" . $.Values.hosts.paths.baseHost }}
http:
{{- end }}
{{- else }}
rules:
{{ range $rule := (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .)).spec.rules }}
- host: {{ .host }}
{{ if .http }}
http:
paths:
{{ with index .http.paths 0 }}
- path: {{ .path }}
pathType: Prefix
backend:
service:
name: {{ .backend.service.name }}
port:
number: {{ .backend.service.port.number }}
{{- end }}
{{ end }}
{{- end }}
{{- end }}
{{- end }}