A k8s init container docker image to deserialise files with directory structure from multiple k8s configMaps.
A helm chart template magda.filesToJson is provided to load files with directory structure into a k8s configMap.
This template support 2 parameters:
filePattern
: Glob file search pattern string. All files (and their dir path) match theGlob
pattern will be encoded and included in the configMap.pathPrefix
: Optional. AddpathPrefix
to all file path generated in configMap JSON.
Example Usage:
apiVersion: v1
kind: ConfigMap
metadata:
name: "my-default-files"
data:
my_default_files.json: {{ include "magda.filesToJson" (dict "root" . "filePattern" "my_dir/**/*" ) }}
Or with pathPrefix
:
apiVersion: v1
kind: ConfigMap
metadata:
name: "my-default-files"
data:
my_default_files.json: {{ include "magda.filesToJson" (dict "root" . "filePattern" "my_dir/**/*" "pathPrefix" "test/" ) }}