Skip to content

A k8s init container docker image to deserialise files with directory structure from multiple k8s configMaps.

License

Notifications You must be signed in to change notification settings

magda-io/magda-configmap-dir-loader

Repository files navigation

magda-configmap-dir-loader

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 the Glob pattern will be encoded and included in the configMap.
  • pathPrefix : Optional. Add pathPrefix 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/" ) }}

About

A k8s init container docker image to deserialise files with directory structure from multiple k8s configMaps.

Resources

License

Stars

Watchers

Forks

Packages