Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce k8s-stack chart size #603

Merged
merged 2 commits into from
Aug 21, 2023
Merged

reduce k8s-stack chart size #603

merged 2 commits into from
Aug 21, 2023

Conversation

Haleygo
Copy link
Contributor

@Haleygo Haleygo commented Aug 6, 2023

address #590
There are two commits, first one is to move /crds to crd subchart, second is to move /dashboards to grafana-dashboard subchart.
After first move, secret data size drops from 741KB->447KB[294KB ⬇️], full data size drops from 5.1MB->3.8MB[1.3MB ⬇️].
All that comes from crd.yaml. Although crd.yaml raw file size is 973KB, after base64 encoding, it’s over 1.26MB. Before saving to secret, got gzip and another base64 encoding, size becomes about 290KB.
image
Second move drops secret data size from 447KB->223KB[224KB ⬇️], full data size drops from 3.63MB->1.74MB[1.89MB ⬇️].
All that comes from /dashboards, the gzip compression ratio on dashboard.yaml is better than crd.yaml apparently.
image
image
But second move brings some side-effects, see those changes under charts/victoria-metrics-k8s-stack/values.yaml. Dashboards resources used to got values from the original grafana subchart and reuse some value like .Values.kubelet.enabled. Now those values need to be redefined in subchart, it could break the old values setting for old users. I tried to use anchor in yaml to sync subchart values from the original ones, but it failed because anchors are evaluated at the time the values file is loaded into memory, but fields updated via the set flag or other occur after the file was loaded.[more detail].
So now it seems no way to reuse the original values completely and it will be a breaking change to all the fields defined in grafana-dashboards subchart’s values.

So the first move itself already has pretty good effect, we are now have more than 500KB under the default value installation, which looks promising to me. I think we can stop there for a while, when we got more dashboards, we can try the next move.
If that's ok to you, I will revert the second commit. @f41gh7 @hagen1778 @Amper

@github-actions github-actions bot added the k8s-stack k8s-stack helm chart related issue label Aug 6, 2023
@hagen1778
Copy link
Contributor

I don't have enoguh understanding to review this. I'd rely on @Amper @f41gh7 reviews

@k1rk
Copy link
Contributor

k1rk commented Aug 11, 2023

@Haleygo
thanks. this is great

i love the idea to go with CRDs only for now, to not introduce breaking change just yet. also anchors hurting readability of values.

so lets do just CRDs for now

and regarding dashboards i was going to explore https://github.com/grafana/thema
or maybe https://github.com/K-Phoen/dark

if you have some time and energy you could explore this options too

@Haleygo
Copy link
Contributor Author

Haleygo commented Aug 13, 2023

Leave only CRDs now, PTAL) @k1rk @f41gh7 @Amper

@k1rk
Copy link
Contributor

k1rk commented Aug 14, 2023

@Haleygo lets bump minor version of k8s-stack chart also for this change

@Haleygo
Copy link
Contributor Author

Haleygo commented Aug 14, 2023

@Haleygo lets bump minor version of k8s-stack chart also for this change

Sure, updated!

@hagen1778
Copy link
Contributor

@Amper @f41gh7 @k1rk did we come up with a resolution? I see this change as a big improvement for helm charts!

@k1rk
Copy link
Contributor

k1rk commented Aug 21, 2023

approved. @Haleygo thanks for a great work

Copy link
Collaborator

@f41gh7 f41gh7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@f41gh7 f41gh7 merged commit 4481f36 into master Aug 21, 2023
13 checks passed
@f41gh7
Copy link
Collaborator

f41gh7 commented Aug 21, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k8s-stack k8s-stack helm chart related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants