Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm configmap error Error: UPGRADE FAILED: ConfigMap "my-service.v130" is invalid: data: Too long: must have at most 1048576 characters

I'm getting this error Error: UPGRADE FAILED: ConfigMap "my-service.v130" is invalid: data: Too long: must have at most 1048576 characters when running the command:

$ KUBECONFIG=/Users/tomcaflisch/.kube/config.dev helm upgrade --wait --recreate-pods --install my-service --version v0.1.0-gedc3d28-dirty  -f ./values.yaml  -f ./secrets.yaml  -f ./vars/dev/db.yaml  -f ./vars/dev/epic.yaml  -f ./vars/dev/ingress.yaml  -f ./vars/dev/services.yaml  -f ./vars/dev/tkn.yaml --set image.tag=v0.1.0-gedc3d28-dirty .

I can't image my generated configmap is even close to that limit. How can i go about debugging this?

like image 366
Catfish Avatar asked Jan 02 '23 09:01

Catfish


2 Answers

That is a known problem, you can find several issues regarding it - that one, for an example.

Configmap objects on Kubernetes have 1Mb size limit and unfortunately (or maybe fortunately) you cannot change it.

Anyway, that is a bad idea to increase the limit, because K8s store Configmaps in Etcd, which don't like large objects.

Helm uses configmap of release for store many things, include chart files and it can be your problem.

Try to add all files (like .git directory) in chart dir (except chart files itself) to .helmignore file and push release another one time.

like image 85
Anton Kostenko Avatar answered Jan 03 '23 21:01

Anton Kostenko


In my case the root cause was very unexpected: the chart folder contained the xxxx.tgz file (the archive file left there by mistake) and until it was deleted, I got this error all the time. The error message isn't even close to the real root cause. It was definitely larger than the 1Mb limitation on the configs.

like image 36
Ilya Yevlampiev Avatar answered Jan 03 '23 23:01

Ilya Yevlampiev