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

update faq for getting nodegroup's userdata and launch templates #8197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions userdocs/src/usage/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@
To change the instance type, create a new nodegroup with the desired instance type, then drain it so that the workloads move to the new one. After that step is complete you can delete the old nodegroup

???+ question "How can I see the generated userdata for a nodegroup?"
First you'll need the name of the Cloudformation stack that manages the
nodegroup:
```console
$ eksctl utils describe-stacks --region=us-west-2 --cluster NAME
```
You'll see a name similar to `eksctl-CLUSTER_NAME-nodegroup-NODEGROUP_NAME`.

You can execute the following to get the userdata. Note the final line which
decodes from base64 and decompresses the gzipped data.
```bash
NG_STACK=eksctl-scrumptious-monster-1595247364-nodegroup-ng-29b8862f # your stack here
LAUNCH_TEMPLATE_ID=$(aws cloudformation describe-stack-resources --stack-name $NG_STACK \
| jq -r '.StackResources | map(select(.LogicalResourceId == "NodeGroupLaunchTemplate")
| .PhysicalResourceId)[0]')
LAUNCH_TEMPLATE_ID=$(aws ec2 describe-launch-templates --filters "Name=tag:eks:cluster-name,Values=CLUSTER_NAME" --filters "Name=tag:eks:nodegroup-name,Values=NODEGROUP_NAME" | jq -r '.LaunchTemplates[0].LaunchTemplateId' )
aws ec2 describe-launch-template-versions --launch-template-id $LAUNCH_TEMPLATE_ID \
| jq -r '.LaunchTemplateVersions[0].LaunchTemplateData.UserData' \
| base64 -d | gunzip
Expand Down