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:
parent
fd259692b8
commit
da7258915f
2 changed files with 28 additions and 8 deletions
28
packages/system/dashboard/templates/console-rbac.yaml
Normal file
28
packages/system/dashboard/templates/console-rbac.yaml
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue