feat(dashboard): serve branding config from ConfigMap via Kubernetes API

Add cozy-dashboard-console-config ConfigMap that renders _cluster.branding
values as JSON. The new console SPA fetches this ConfigMap at startup via
the Kubernetes API (/api/v1/namespaces/cozy-dashboard/configmaps/...) and
applies titleText, logoSvg, logoText without requiring nginx volume mounts
or pod restarts.

Add Role/RoleBinding granting system:authenticated read access to the
specific ConfigMap so the browser-side K8s API call succeeds.

Signed-off-by: IvanHunters <ivan.okhotnikov@aenix.io>
This commit is contained in:
IvanHunters 2026-04-30 01:05:23 +03:00
parent fd259692b8
commit da7258915f
No known key found for this signature in database
GPG key ID: BB2523A864CCA99B
2 changed files with 28 additions and 8 deletions

View file

@ -0,0 +1,28 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cozy-dashboard-console-config-reader
namespace: cozy-dashboard
rules:
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- cozy-dashboard-console-config
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cozy-dashboard-console-config-reader
namespace: cozy-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cozy-dashboard-console-config-reader
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:authenticated

View file

@ -83,14 +83,6 @@ spec:
type: RuntimeDefault
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: console-config
mountPath: /usr/share/nginx/html/config.json
subPath: config.json
volumes:
- name: console-config
configMap:
name: cozy-dashboard-console-config
dnsPolicy: ClusterFirst
enableServiceLinks: false
hostIPC: false