WIP aws: download nodeup from private S3 buckets with curl - #18660
Open
hakman wants to merge 6 commits into
Open
WIP aws: download nodeup from private S3 buckets with curl#18660hakman wants to merge 6 commits into
hakman wants to merge 6 commits into
Conversation
When KOPS_BASE_URL is an s3:// URL, the bootstrap script downloads nodeup with curl 8.0 or newer, signing the request with instance profile credentials from IMDS using curl's native AWS SigV4 support. The credentials are piped through --config -, so they never reach disk, process arguments, or console logs. The s3:// URL does not carry the bucket region required by SigV4, so kOps resolves it through VFS before rendering the bootstrap script. Validation rejects AWS partitions whose endpoints are incompatible with the generated download URL. spec.assets.fileRepository now accepts an s3:// URL on AWS. Nodeup reads these assets through VFS using instance credentials, and remapped repository paths escape delimiter commas before compact asset serialization. The e2e tooling stages AWS pull artifacts in S3 to exercise this path. The kubetest2 deployer creates a staging bucket for AWS builds and deletes it during --down. Its name is derived from the whole BUILD_ID, so every invocation of a test run derives the same name without passing state between them, and no scenario script has to signal the teardown.
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
publishedBaseURL rewrote the staged location to the legacy global S3 endpoint bucket.s3.amazonaws.com, which only serves us-east-1 directly, so reading the nodeup hash failed for buckets in every other region. Keeping the s3:// form lets the kops CLI read the assets through VFS and makes the nodes download nodeup with their instance profile, which is the path under test. Also promote smithy-go to a direct dependency of the e2e module.
EscapedPath returns RawPath only when it unescapes to exactly Path, so the RawPath left over from parsing the file repository is already ignored once path.Join has changed Path. Clearing it first changed nothing.
Extract the repeated IMDS curl invocation and the credential field regex into imds-get and json-field helpers. The credential parsing then folds into the existing if/elif chain, removing a nested conditional, an associative array, two locals and the nounset fallbacks that only existed to guard it.
json-field returns non-zero when a field is missing, so assigning each field in the chain turns a changed credentials payload into its own message instead of an empty signature and a 403 blamed on the download.
Contributor
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When KOPS_BASE_URL is an s3:// URL, the bootstrap script downloads nodeup with curl 8.0 or newer, signing the request with instance profile credentials from IMDS using curl's native AWS SigV4 support. The credentials are piped through --config -, so they never reach disk, process arguments, or console logs.
The s3:// URL does not carry the bucket region required by SigV4, so kOps resolves it through VFS before rendering the bootstrap script. Validation rejects AWS partitions whose endpoints are incompatible with the generated download URL.
spec.assets.fileRepository now accepts an s3:// URL on AWS. Nodeup reads these assets through VFS using instance credentials, and remapped repository paths escape delimiter commas before compact asset serialization.
The e2e tooling stages AWS pull artifacts in S3 to exercise this path. The kubetest2 deployer creates a staging bucket for AWS builds and deletes it during --down. Its name is derived from the whole BUILD_ID, so every invocation of a test run derives the same name without passing state between them, and no scenario script has to signal the teardown.