Skip to content

Commit d8d85fc

Browse files
authored
feat(helm): add branding configmap for custom assets (#3008)
1 parent 56bc809 commit d8d85fc

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if .Values.branding.enabled }}
2+
---
3+
# Branding ConfigMap
4+
# Mounts custom branding assets (logos, CSS, etc.) into the application
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: {{ include "sim.fullname" . }}-branding
9+
namespace: {{ .Release.Namespace }}
10+
labels:
11+
{{- include "sim.labels" . | nindent 4 }}
12+
app.kubernetes.io/component: branding
13+
{{- if .Values.branding.files }}
14+
data:
15+
{{- range $key, $value := .Values.branding.files }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
{{- if .Values.branding.binaryFiles }}
20+
binaryData:
21+
{{- range $key, $value := .Values.branding.binaryFiles }}
22+
{{ $key }}: {{ $value }}
23+
{{- end }}
24+
{{- end }}
25+
{{- end }}

helm/sim/templates/deployment-app.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,27 @@ spec:
110110
{{- end }}
111111
{{- include "sim.resources" .Values.app | nindent 10 }}
112112
{{- include "sim.securityContext" .Values.app | nindent 10 }}
113-
{{- if or .Values.extraVolumeMounts .Values.app.extraVolumeMounts }}
113+
{{- if or .Values.branding.enabled .Values.extraVolumeMounts .Values.app.extraVolumeMounts }}
114114
volumeMounts:
115+
{{- if .Values.branding.enabled }}
116+
- name: branding
117+
mountPath: {{ .Values.branding.mountPath | default "/app/public/branding" }}
118+
readOnly: true
119+
{{- end }}
115120
{{- with .Values.extraVolumeMounts }}
116121
{{- toYaml . | nindent 12 }}
117122
{{- end }}
118123
{{- with .Values.app.extraVolumeMounts }}
119124
{{- toYaml . | nindent 12 }}
120125
{{- end }}
121126
{{- end }}
122-
{{- if or .Values.extraVolumes .Values.app.extraVolumes }}
127+
{{- if or .Values.branding.enabled .Values.extraVolumes .Values.app.extraVolumes }}
123128
volumes:
129+
{{- if .Values.branding.enabled }}
130+
- name: branding
131+
configMap:
132+
name: {{ include "sim.fullname" . }}-branding
133+
{{- end }}
124134
{{- with .Values.extraVolumes }}
125135
{{- toYaml . | nindent 8 }}
126136
{{- end }}

helm/sim/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,32 @@ sharedStorage:
738738
extraVolumes: []
739739
extraVolumeMounts: []
740740

741+
# Branding configuration
742+
# Use this to inject custom branding assets (logos, CSS, etc.) into the application
743+
branding:
744+
# Enable/disable branding ConfigMap
745+
enabled: false
746+
747+
# Mount path in the container where branding files will be available
748+
mountPath: "/app/public/branding"
749+
750+
# Text files (CSS, JSON, HTML, etc.) - values are plain text
751+
# Example:
752+
# files:
753+
# custom.css: |
754+
# .logo { background-color: #ff0000; }
755+
# config.json: |
756+
# {"theme": "dark"}
757+
files: {}
758+
759+
# Binary files (PNG, JPG, ICO, etc.) - values must be base64 encoded
760+
# Generate base64 with: base64 -i logo.png | tr -d '\n'
761+
# Example:
762+
# binaryFiles:
763+
# logo.png: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk..."
764+
# favicon.ico: "AAABAAEAEBAAAAEAIABoBAAAFgAAAA..."
765+
binaryFiles: {}
766+
741767
# Additional environment variables for custom integrations
742768
extraEnvVars: []
743769

0 commit comments

Comments
 (0)