mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 14:02:56 +09:00
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:
2 files changed
+28
-8
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user