-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
better handle non eks optimized amis #2073
Conversation
@jaxesn linter found some trailing spaces: https://github.com/awslabs/amazon-eks-ami/actions/runs/11981467999/job/33628858679?pr=2073#step:5:82 /ci |
@cartermckinnon roger that! I've dispatched a workflow. 👍 |
|
||
timeout 75 snap get kubelet-eks > "${COLLECT_DIR}"/kubelet/kubelet-eks_service.txt 2>&1 | ||
cp --force --recursive --dereference /etc/kubernetes/kubelet/kubelet-config.json "${COLLECT_DIR}"/kubelet/kubelet-config.json 2> /dev/null | ||
fi | ||
;; |
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.
INIT_TYPE
is set by checking if systemctl
or snap
is on the PATH
, so I don't think this block actually changes any logic
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.
The change is that before if INIT_TYPE
is snap
it collects the kubelet logs use snap get kubelet-eks
. In the case that you are on the Ubuntu optimized ami that is the source of the kubelet so the logs are correctly retrieved. If you are running on a different type of Ubuntu host, with snap, but not the kubelet-eks
snap installed you do not capture any kubelet logs. In this sceanrio, we want to fallback to using journalctl to collect the kubelet logs as if it was just a normal systemd
INIT_TYPE
.
@cartermckinnon the workflow that you requested has completed. 🎉
|
27d504a
to
221e750
Compare
Description of changes:
When running the log collector script on OS images other than the standard AL2/23 eks optimized ami and without the vpc-cni, there are a few potentially confusing log messages due to missing files/execs. This adds:
command -v
checks around specific bins,lvs
pvs
vgs
ipvsadm
ipset
conntrack
aws-eks-na-cli
similar to others within this script./var/run/aws-node/ipam.json
does not exist.The one somewhat functional change is to handle Ubuntu nodes. Ubuntu is
INIT_TYPE
snap
in the script and when kubelet logs are retrieve the snapkubelet-eks
is assumed to exist. The change checks for existence of thekubelet-eks
snap and if it does not exist, falls back to the normal kubelet log collecting. Without this change, the kubelet logs would not be collected for these kinds of nodes.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing Done
Old Output:
New Output:
See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.