Skip to content

Commit 545e256

Browse files
committed
[platform] refactor dashboard values
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent a240c0b commit 545e256

4 files changed

Lines changed: 64 additions & 135 deletions

File tree

‎packages/core/platform/bundles/paas-full.yaml‎

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -260,72 +260,15 @@ releases:
260260
releaseName: dashboard
261261
chart: cozy-dashboard
262262
namespace: cozy-dashboard
263-
dependsOn: [cilium,kubeovn,keycloak-configure]
264263
values:
265-
kubeapps:
266-
{{- if .Capabilities.APIVersions.Has "source.toolkit.fluxcd.io/v1" }}
267-
{{- with (lookup "source.toolkit.fluxcd.io/v1" "HelmRepository" "cozy-public" "").items }}
268-
redis:
269-
master:
270-
podAnnotations:
271-
{{- range $index, $repo := . }}
272-
{{- with (($repo.status).artifact).revision }}
273-
repository.cozystack.io/{{ $repo.metadata.name }}: {{ quote . }}
274-
{{- end }}
275-
{{- end }}
276-
{{- end }}
277-
{{- end }}
278-
frontend:
279-
resourcesPreset: "none"
280-
dashboard:
281-
resourcesPreset: "none"
282-
{{- $cozystackBranding:= lookup "v1" "ConfigMap" "cozy-system" "cozystack-branding" }}
283-
{{- $branding := dig "data" "branding" "" $cozystackBranding }}
284-
{{- if $branding }}
285-
customLocale:
286-
"Kubeapps": {{ $branding }}
287-
{{- end }}
288-
customStyle: |
289-
{{- $logoImage := dig "data" "logo" "" $cozystackBranding }}
290-
{{- if $logoImage }}
291-
.kubeapps-logo {
292-
background-image: {{ $logoImage }}
293-
}
294-
{{- end }}
295-
#serviceaccount-selector {
296-
display: none;
297-
}
298-
.login-moreinfo {
299-
display: none;
300-
}
301-
a[href="#/docs"] {
302-
display: none;
303-
}
304-
.login-group .clr-form-control .clr-control-label {
305-
display: none;
306-
}
307-
.appview-separator div.appview-first-row div.center {
308-
display: none;
309-
}
310-
.appview-separator div.appview-first-row section[aria-labelledby="app-secrets"] {
311-
display: none;
312-
}
313-
.appview-first-row section[aria-labelledby="access-urls-title"] {
314-
width: 100%;
315-
}
316-
{{- $dashboardKCconfig := lookup "v1" "ConfigMap" "cozy-dashboard" "kubeapps-auth-config" }}
317-
{{- $dashboardKCValues := dig "data" "values.yaml" "" $dashboardKCconfig }}
318-
{{- if $dashboardKCValues }}
319-
valuesFrom:
320-
- kind: ConfigMap
321-
name: kubeapps-auth-config
322-
valuesKey: values.yaml
323-
{{- end }}
324-
264+
{{- $dashboardKCconfig := lookup "v1" "ConfigMap" "cozy-dashboard" "kubeapps-auth-config" }}
265+
{{- $dashboardKCValues := dig "data" "values.yaml" (dict) $dashboardKCconfig | fromYaml }}
266+
{{- toYaml (deepCopy $dashboardKCValues | mergeOverwrite (fromYaml (include "cozystack.defaultDashboardValues" .))) | nindent 4 }}
267+
dependsOn:
268+
- cilium
269+
- kubeovn
325270
{{- if eq $oidcEnabled "true" }}
326-
dependsOn: [keycloak-configure]
327-
{{- else }}
328-
dependsOn: []
271+
- keycloak-configure
329272
{{- end }}
330273

331274
- name: kamaji

‎packages/core/platform/bundles/paas-hosted.yaml‎

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -155,66 +155,9 @@ releases:
155155
chart: cozy-dashboard
156156
namespace: cozy-dashboard
157157
values:
158-
kubeapps:
159-
{{- if .Capabilities.APIVersions.Has "source.toolkit.fluxcd.io/v1" }}
160-
{{- with (lookup "source.toolkit.fluxcd.io/v1" "HelmRepository" "cozy-public" "").items }}
161-
redis:
162-
master:
163-
podAnnotations:
164-
{{- range $index, $repo := . }}
165-
{{- with (($repo.status).artifact).revision }}
166-
repository.cozystack.io/{{ $repo.metadata.name }}: {{ quote . }}
167-
{{- end }}
168-
{{- end }}
169-
{{- end }}
170-
{{- end }}
171-
frontend:
172-
resourcesPreset: "none"
173-
dashboard:
174-
resourcesPreset: "none"
175-
{{- $cozystackBranding:= lookup "v1" "ConfigMap" "cozy-system" "cozystack-branding" }}
176-
{{- $branding := dig "data" "branding" "" $cozystackBranding }}
177-
{{- if $branding }}
178-
customLocale:
179-
"Kubeapps": {{ $branding }}
180-
{{- end }}
181-
customStyle: |
182-
{{- $logoImage := dig "data" "logo" "" $cozystackBranding }}
183-
{{- if $logoImage }}
184-
.kubeapps-logo {
185-
background-image: {{ $logoImage }}
186-
}
187-
{{- end }}
188-
#serviceaccount-selector {
189-
display: none;
190-
}
191-
.login-moreinfo {
192-
display: none;
193-
}
194-
a[href="#/docs"] {
195-
display: none;
196-
}
197-
.login-group .clr-form-control .clr-control-label {
198-
display: none;
199-
}
200-
.appview-separator div.appview-first-row div.center {
201-
display: none;
202-
}
203-
.appview-separator div.appview-first-row section[aria-labelledby="app-secrets"] {
204-
display: none;
205-
}
206-
.appview-first-row section[aria-labelledby="access-urls-title"] {
207-
width: 100%;
208-
}
209-
{{- $dashboardKCconfig := lookup "v1" "ConfigMap" "cozy-dashboard" "kubeapps-auth-config" }}
210-
{{- $dashboardKCValues := dig "data" "values.yaml" "" $dashboardKCconfig }}
211-
{{- if $dashboardKCValues }}
212-
valuesFrom:
213-
- kind: ConfigMap
214-
name: kubeapps-auth-config
215-
valuesKey: values.yaml
216-
{{- end }}
217-
158+
{{- $dashboardKCconfig := lookup "v1" "ConfigMap" "cozy-dashboard" "kubeapps-auth-config" }}
159+
{{- $dashboardKCValues := dig "data" "values.yaml" (dict) $dashboardKCconfig }}
160+
{{- toYaml (deepCopy $dashboardKCValues | mergeOverwrite (fromYaml (include "cozystack.defaultDashboardValues" .))) | nindent 4 }}
218161
{{- if eq $oidcEnabled "true" }}
219162
dependsOn: [keycloak-configure]
220163
{{- else }}

‎packages/core/platform/templates/_helpers.tpl‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,57 @@ Get IP-addresses of master nodes
1616
{{- end -}}
1717
{{ join "," $ips }}
1818
{{- end -}}
19+
20+
{{- define "cozystack.defaultDashboardValues" -}}
21+
kubeapps:
22+
{{- if .Capabilities.APIVersions.Has "source.toolkit.fluxcd.io/v1" }}
23+
{{- with (lookup "source.toolkit.fluxcd.io/v1" "HelmRepository" "cozy-public" "").items }}
24+
redis:
25+
master:
26+
podAnnotations:
27+
{{- range $index, $repo := . }}
28+
{{- with (($repo.status).artifact).revision }}
29+
repository.cozystack.io/{{ $repo.metadata.name }}: {{ quote . }}
30+
{{- end }}
31+
{{- end }}
32+
{{- end }}
33+
{{- end }}
34+
frontend:
35+
resourcesPreset: "none"
36+
dashboard:
37+
resourcesPreset: "none"
38+
{{- $cozystackBranding:= lookup "v1" "ConfigMap" "cozy-system" "cozystack-branding" }}
39+
{{- $branding := dig "data" "branding" "" $cozystackBranding }}
40+
{{- if $branding }}
41+
customLocale:
42+
"Kubeapps": {{ $branding }}
43+
{{- end }}
44+
customStyle: |
45+
{{- $logoImage := dig "data" "logo" "" $cozystackBranding }}
46+
{{- if $logoImage }}
47+
.kubeapps-logo {
48+
background-image: {{ $logoImage }}
49+
}
50+
{{- end }}
51+
#serviceaccount-selector {
52+
display: none;
53+
}
54+
.login-moreinfo {
55+
display: none;
56+
}
57+
a[href="#/docs"] {
58+
display: none;
59+
}
60+
.login-group .clr-form-control .clr-control-label {
61+
display: none;
62+
}
63+
.appview-separator div.appview-first-row div.center {
64+
display: none;
65+
}
66+
.appview-separator div.appview-first-row section[aria-labelledby="app-secrets"] {
67+
display: none;
68+
}
69+
.appview-first-row section[aria-labelledby="access-urls-title"] {
70+
width: 100%;
71+
}
72+
{{- end }}

‎packages/core/platform/templates/helmreleases.yaml‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ spec:
7272
{{- toYaml . | nindent 4}}
7373
{{- end }}
7474

75-
{{- if $x.valuesFrom }}
76-
valuesFrom:
77-
{{- range $source := $x.valuesFrom }}
78-
- kind: {{ $source.kind }}
79-
name: {{ $source.name }}
80-
{{- if $source.valuesKey }}
81-
valuesKey: {{ $source.valuesKey }}
82-
{{- end }}
83-
{{- end }}
84-
{{- end }}
85-
8675
{{- with $x.dependsOn }}
8776
dependsOn:
8877
{{- range $dep := . }}

0 commit comments

Comments
 (0)