-
Notifications
You must be signed in to change notification settings - Fork 1.7k
systemd: build: fix service startup failure when using IMDSv2 #10221
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
base: master
Are you sure you want to change the base?
systemd: build: fix service startup failure when using IMDSv2 #10221
Conversation
cc450b4
to
08fdd4a
Compare
Hi there, any chance this could be merged in soon? We have paused updates on our servers because we don't want to have to write an automation script to disable the fluent-bit repository on each instance. (The related bug affects ~125 instance within my org.) Thanks! |
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'd confirmed that this patch works under IMDSv2.
Could you rebase off the current master?
This is because at the moment of sending this PR, our CI was broken.
So, we wanted to do CI at least once.
I'd confirmed that the same logs on my created EC2 instance:
|
d11d346
to
08fdd4a
Compare
PR fluent#9845 added a service dependency "sethostname.service" for Amazon Linux 2, which uses Amazon's Instance Metadata Service (IMDS) to query and set the hostname. This works for instances using the legacy IMDSv1, however it fails when admins have enforced the usage of IMDSv2. This patch is a modification of @cpandya-we comment/work on fluent#10186. Fixes fluent#10186 Signed-off-by: Charlton Stanley <[email protected]>
08fdd4a
to
5d83094
Compare
@cosmo0920 Thanks for verifying my patch. Rebase has been done! |
PR #9845 added a service dependency
sethostname.service
for Amazon Linux 2, which uses Amazon's Instance Metadata Service (IMDS) to query and set the hostname. This works for instances using the legacy IMDSv1, however it fails when admins have enforced the usage of IMDSv2. This patch is a modification of @cpandya-we's comment/work on #10186. Closes #10186Note: I used modified versions of the code samples @cosmo0920 submitted in #9845. Specifically, note the differences in the packer file, where IMDSv2 support was enabled.
Testing
Log output confirming both
fluent-bit.service
andsethostname.service
service start successfully.Here is the packer template for creating AMI. Note the addition of the the
imds_support
property, as well as the additionalmetadata_options
.If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.