Skip to content

release secret size optimization #11493

Open

Description

@elopsod

hi
we started to get an error Too long: must have at most 1048576 bytes when tried to install victoria-metrics-k8s-stack.
investigation shows that if we install victoria-metrics-k8s-stack chart, decode sh.helm.release.v1 secret has size 6.56MB(encode secret size: 840924 bytes) and structure
image

but if we add victoria-metrics-k8s-stack to dependencies of empty chart

apiVersion: v2
description: A Helm chart for Kubernetes
name: emptyChart
version: 0.1.0-SNAPSHOT
dependencies:
  - name: victoria-metrics-k8s-stack
    alias: victoria-metrics-k8s-stack
    version: ~0.0.0-0
    repository: https://victoriametrics.github.io/helm-charts/

decode sh.helm.release.v1 secret has size 2.94MB(encode secret size: 211660 bytes) and structure
image

the difference in size between the first and second options for installing is 2 times.
As far as I understand, this is because in the second option everything is stored in the manifest field and this gives significant savings.
is it possible to optimize the first option so that all templates are stored in the manifest field (mean combine everything that is in the chart field with the manifest field)

Output of helm version:
version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"ab69524f795c42094a6630298ff53f3c3ebab7f4", GitTreeState:"clean", BuildDate:"2021-12-07T18:16:20Z", GoVersion:"go1.17.3", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
1.21.10-gke.2000

Activity

  1. added
    v4.x
    on Nov 4, 2022
  2. joejulian commented on Nov 4, 2022

    @joejulian
    Contributor

    This would be a breaking change and would need to go into a major version change.

  3. Haleygo commented on Aug 1, 2023

    @Haleygo

    @joejulian @bacongobbler Hello, is there any update on this one)
    And what's the influences if I move some of the resources to subchart to save spaces for release's secret?
    There is no notice in subchart doc about when we should keep resources in chart instead of subchart. And I think command like helm rollback,helm get manifest won't use data under "/templates" and "/files", but only use those rendered resources files under "/manifests", noted in #8480 (comment) too.
    helm show helm package could use those fields, but they have nothing to do with release's secret, does this mean those fields' data can be deleted from release secret? Thanks in advance!
    image

  4. IAmPattycakes commented on Nov 3, 2023

    @IAmPattycakes

    One possible solution could be the addition of a flag --extended-release-manifest or something, that simply supports chunking of manifests. The file structure that everything gets saved as would remain the same, however if it's detected that it will be longer than what etcd will support, sh.helm.release.v1 could be chunked into sh.helm.release.v1-part1 and sh.helm.release.v1-part2, etc. An intermediate step would just include detection of that -partx chunks, grabbing all of them, and concatenating the string in order before finally processing it as currently happens.
    If this doesn't sound like it horribly violates design principles or anything, I can work on a HIP and try to get this in if it's approved.

  5. Haleygo commented on Nov 9, 2023

    @Haleygo

    One possible solution could be the addition of a flag --extended-release-manifest or something, that simply supports chunking of manifests. The file structure that everything gets saved as would remain the same, however if it's detected that it will be longer than what etcd will support, sh.helm.release.v1 could be chunked into sh.helm.release.v1-part1 and sh.helm.release.v1-part2, etc. An intermediate step would just include detection of that -partx chunks, grabbing all of them, and concatenating the string in order before finally processing it as currently happens. If this doesn't sound like it horribly violates design principles or anything, I can work on a HIP and try to get this in if it's approved.

    I think there is a similar HIP to split the release secret.

  6. Hammond95 commented on May 23, 2024

    @Hammond95

    will this ever be implemented? What are the plans for this?

    Is there any alternative approach that we can take?

  7. carlossg commented on Jun 21, 2024

    @carlossg
    Contributor

    currently the options are

    1. splitting chart into subcharts as mentioned by @Haleygo in helm chart size optimization VictoriaMetrics/helm-charts#590 (comment)
    2. use the database driver to store the data in postgres
    3. proposal to split into multiple secrets HIP Support Helm release data stored in multiple K8s Secrets community#256
    4. maybe change the compression algorithm (I commented in the HIP HIP Support Helm release data stored in multiple K8s Secrets community#256 (comment))

    1 and 3 still have the issue that etcd data gets filled if you have enough helm releases

  8. tmijieux commented on Mar 26, 2025

    @tmijieux

    I encoutered a similar issue today.

    But my problem was NOT that the chart (templates and variables) was too big, but the chart was actually at the root of a git repository and the .git directory was included in the "files" property and adding the ".git" line to the .helmignore file fixed my problem, (if this may be of some help to some people)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurev4.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions