0

ok I have a huge applications with multiple components, each have plentyful config files

directory tree looks like this

# ls -1 .
Chart.yaml
configs
templates
values.yaml

# ls -1 configs
component1-config
component2-config
component3-config
component4-config

# ls -1 templates
component1.yaml
component2.yaml
component3.yaml
component4.yaml
_helpers.tpl
secrets.yaml

I am creating configmaps for multiple folders of each component like this

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-component1-folder1
  namespace: {{ .Values.nSpace }}
data:
{{ $currentScope := . }}
{{ range $path, $_ :=  .Files.Glob  "configs/component1/folder1/**" }}
{{- with $currentScope}}
  {{ (base $path) }}: |-
{{ .Files.Get $path | indent 6 }}
{{ end }}
{{ end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-component1-folder2
  namespace: {{ .Values.nSpace }}
data:
{{ $currentScope := . }}
{{ range $path, $_ :=  .Files.Glob  "configs/component1/folder2/**" }}
{{- with $currentScope}}
  {{ (base $path) }}: |-
{{ .Files.Get $path | indent 6 }}
{{ end }}
{{ end }}

and some standard deployment & services also included problem is when I run helm install myapp . it throws this data too long error which I want to avoid, as my application may grow.

Error: INSTALLATION FAILED: create: failed to create: Secret "sh.helm.release.v1.myapp.v1" is invalid: data: Too long: must have at most 1048576 bytes
Sollosa
  • 1,887
  • 4
  • 19
  • 32

1 Answers1

0

files or folders (including hidden files and folders) in your chart cannot be larger (approximately) 1MB. You need to delete them or put them in the .hemignore file to exclude.
In my case, .git folder is bigger than 1MB and it is not needed, after deleting it, helm install works.

enter image description here

The same issue:
https://github.com/helm/helm/issues/1996

quoc9x
  • 101
  • 2