|
1 | 1 | {{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }} |
2 | 2 | {{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }} |
| 3 | +{{- $host := index $cozyConfig.data "root-host" }} |
| 4 | +{{- $exposeServices := splitList "," ((index $cozyConfig.data "expose-services") | default "") }} |
| 5 | +{{- $exposeIngress := index $cozyConfig.data "expose-ingress" | default "tenant-root" }} |
3 | 6 |
|
4 | | -{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }} |
5 | | -{{- $host := index $myNS.metadata.annotations "namespace.cozystack.io/host" }} |
6 | | - |
7 | | -{{- $tenantRoot := dict }} |
8 | | -{{- if .Capabilities.APIVersions.Has "helm.toolkit.fluxcd.io/v2" }} |
9 | | -{{- $tenantRoot = lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" "tenant-root" "tenant-root" }} |
10 | | -{{- end }} |
11 | | -{{- if and $tenantRoot $tenantRoot.spec $tenantRoot.spec.values $tenantRoot.spec.values.host }} |
12 | | -{{- $host = $tenantRoot.spec.values.host }} |
13 | | -{{- else }} |
14 | | -{{- end }} |
15 | | - |
16 | | -{{- if .Values.dashboard }} |
| 7 | +{{- if and (has "dashboard" $exposeServices) }} |
17 | 8 | apiVersion: networking.k8s.io/v1 |
18 | 9 | kind: Ingress |
19 | 10 | metadata: |
20 | 11 | annotations: |
21 | 12 | cert-manager.io/cluster-issuer: letsencrypt-prod |
22 | 13 | {{- if eq $issuerType "cloudflare" }} |
23 | 14 | {{- else }} |
24 | | - acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }} |
| 15 | + acme.cert-manager.io/http01-ingress-class: {{ $exposeIngress }} |
| 16 | + {{- end }} |
25 | 17 | nginx.ingress.kubernetes.io/proxy-body-size: 100m |
26 | 18 | nginx.ingress.kubernetes.io/proxy-buffer-size: 100m |
27 | 19 | nginx.ingress.kubernetes.io/proxy-buffers-number: "4" |
28 | 20 | nginx.ingress.kubernetes.io/client-max-body-size: 100m |
29 | | - {{- end }} |
30 | | - name: dashboard-{{ .Release.Namespace }} |
| 21 | + name: dashboard |
31 | 22 | namespace: cozy-dashboard |
32 | 23 | spec: |
33 | | - ingressClassName: {{ .Release.Namespace }} |
| 24 | + ingressClassName: {{ $exposeIngress }} |
34 | 25 | rules: |
35 | 26 | - host: dashboard.{{ $host }} |
36 | 27 | http: |
|
45 | 36 | tls: |
46 | 37 | - hosts: |
47 | 38 | - dashboard.{{ $host }} |
48 | | - secretName: dashboard-{{ .Release.Namespace }}-tls |
| 39 | + secretName: dashboard-tls |
49 | 40 | {{- end }} |
0 commit comments