Reduce boilerplate in AWS LaunchTemplate
1. Describe IN DETAIL the feature/behavior/change you would like to see.
In Kops 1.19.0-alpha.5, we can't start a new cluster anymore because of the size limitation of user data in AWS launch templates, which is 16k. We have approximately 3k of our own user data, and for the master nodes, deployment fails with
error running task "LaunchTemplate/master-eu-central-1b.masters.cluster.<domain>" (26s remaining to succeed): error creating LaunchTemplate: InvalidUserData.Malformed: User data is limited to 16384 bytes.
Looking into the Launch templates for the non-master instance groups, I see that Kops own part already takes up 10k for them, and most likely even more than 13k for masters, since our own user data is the same for them.
I'd like to see the boilerplate in the user data being reduces as much as possible, leaving more space for custom user data. For example, just the license header in the embedded nodeup.sh is taking up 607 bytes.
Additionally, the documentation should warn about the limited space for custom user data, so users can mitigate before running into this issue.
2. Feel free to provide a design supporting your feature request.
E.g. remove the license header from the embedded nodeup.sh script, and also other comments, unccessary blank lines etc.
After removing most of our custom user data, I can confirm that Kops already uses up 15k of the user data on master nodes! 😳
The typical master user data should be around 12-13k. But since user data contains the cluster spec and the spec also contains additionalUserData, 3k will result in 6k added data.
3k of additional user data is quite sizeable though. Maybe some of this could be moved to a hook instead?
@olemarkus Sorry, I was talking about just the userData in the cluster spec, there is no duplication of our userData I can see (after reducing it significantly). But our list of fileAssets is also adding 1.5k.
I'll try to reduce our userData and fileAssets as much as possible by shifting stuff into the AMI, but I still think the Kops part should also be minimized.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
We also can't update kops in clusters from 1.18 to 1.19 because of file assets. Can user-data be decreased?
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-contributor-experience at kubernetes/community. /close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen. Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-contributor-experience at kubernetes/community. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
We are experiencing the same issues trying to create a new cluster via kops-1.21-alpha-3.
I'm also running into this updating a cluster from 1.19 to 1.20
@Nilubkal: You can't reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/reopen
@rifelpet: Reopened this issue.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
We are experiencing the same issues trying to create a new cluster via
kops-1.21-alpha-3.
just applying exactly the same template ( the same size/length ) with kops-1.20.0 and KOPS_RUN_TOO_NEW_VERSION=1 creates a kubernetes 1.21.0 cluster without any complains about "User data is limited to 16384 bytes"
Another workaround is using the setting for the InstanceGroup:
spec:
compressUserData: true
introduced by this PR
This isn't a workaround. This is the solution for those who depend on extending the user data. Often, hooks is a better mechanism for manipulating the instance during boot. But it depends on what you are putting into user data.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten