-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Give users the option to gzip and base64 encode the heredocs in the nodeup.sh user-data #10357
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rdrgmnzs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Spot checking the integration test outputs it looks like we can expect an approx 20 or 30% savings for nodes and masters respectively. The downside of this approach is the reduced visibility in dryrun diffs - though typically during an upgrade, changes here matter less than changes in nodeup itself which has no visibility in dryrun diffs. |
Agreed on losing the visibility, I was actually playing with the idea of only encoding the heredocs if the user-data was over 15K however that got pretty ugly so I dropped it. |
@rdrgmnzs would it be possible to make this optional? I would hate to go back to the dark ages when integration tests changes are less easy to understand. 😄 What do you think about compressing the actual script (or part of it) instead of the specs and env? This would change much less often. |
I don't think we can have it both ways. But I wonder if we really need all the content in the heredoc too. At least the duplication ... I vote merging this in so that we don't mess up too much for 1.19 users with custom userdata. Then look for better solutions for 1.20. |
For me it is important to see what changes in integration tests. |
We could potentially set a bool in a struct and pass it all the way down to the nodeup script generation, that if set would then cause the heredocs to be compressed. We'd just pass gzipBase64 to the template as another function to use to gzip when the template is executed and use if blocks (with the previously mentioned var) to pick if we want to use the compressed version or not. Let me do some digging tomorrow during the day to see how hard it would be to implement the above. |
6231d89
to
65e7e1e
Compare
65e7e1e
to
6cef454
Compare
6cef454
to
5f2a335
Compare
b0ec704
to
c3fe6fa
Compare
c3fe6fa
to
d6d4cad
Compare
pkg/model/bootstrapscript.go
Outdated
context := map[string]interface{}{ | ||
"compressStructs": b.ig.Spec.CompressUserData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see NodeUpSource
and NodeUpSourceHash
are implemented as functions should we use the same approach?
Very nice, I think giving the user the option is a good middle ground on this one. |
I agree, nice work 👍🏻 can we add docs and maybe a release note for this? |
d6d4cad
to
e85f714
Compare
e85f714
to
3fb12c6
Compare
/lgtm |
Automated cherry pick of #10357 onto release-1.19
gzip and base64 encode the heredocs in the nodeup.sh user-data, this is to accommodate the fact that there is a 15K limit on user-data in AWS and as our specs keep growing we are more and more likely to hit this limit.
This is an alternative to #10280
/cc @hakman @olemarkus