1

I have a common set of files that goes into configmap from common/config-dir and few chart specific config files in appchart/config-dir

I am following the documentation from Helm.sh for using library charts to merge common and chart specific data. I am specifying {{ (.Files.Glob "config-dir/*").AsConfig | indent 2 }} right under data in both common library chart as well as appchart, However, library chart is not picking up the config-dir files from common chart.

Attaching _configmap.yaml from common library chart and configmap.yaml from application chart.

_configmap.yaml

{{- define "common.configmap.tpl" -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name | printf "%s-%s" .Chart.Name }}
data: 
{{ (.Files.Glob "config-dir/*").AsConfig | indent 2 }}
{{- end -}}

{{- define "common.configmap" -}}
{{- include "common.util.merge" (append . "common.configmap.tpl") -}}
{{- end -}}

configmap.yaml

{{- include "common.configmap" (list . "appchart.configmap") -}}

{{- define "appchart.configmap" -}}
data: 
{{ (.Files.Glob "config-dir/*").AsConfig | indent 2 }}
{{- end -}}
Venu S
  • 3,251
  • 1
  • 9
  • 25
  • I'm assuming that path don't match can you try deploying the chart with `--debug --dry-run`? – Crou May 26 '20 at 12:37
  • @Crou when I tried to debug, its picking up the files only from `appchart/config-dir` but not `common/config-dir/*` Tried to give a clear description here : https://github.com/helm/helm/issues/8200 – Venu S May 28 '20 at 23:04

1 Answers1

-1

Before getting into the problem, what is the size of those library files? There is a hard-limit of configmap not from kubernetes but from etcd of 1MB. If the files per configmap are greater than 1MB you should be using volumes for that purpose.

Please check configmap hard-limits. Kubernetes ConfigMap size limitation

Next can you run the helm install command with --debug and --dry-run flag and paste the output.

Next step can be to further go into the granularity separate the subchart and try using the same template and check it.

redzack
  • 1,521
  • 8
  • 20