Skip to content

WIP aws: download nodeup from private S3 buckets with curl - #18660

Open
hakman wants to merge 6 commits into
kubernetes:masterfrom
hakman:hakman-fix-s3-bootstrap-encoding
Open

WIP aws: download nodeup from private S3 buckets with curl#18660
hakman wants to merge 6 commits into
kubernetes:masterfrom
hakman:hakman-fix-s3-bootstrap-encoding

Conversation

@hakman

@hakman hakman commented Aug 2, 2026

Copy link
Copy Markdown
Member

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.

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.
@hakman hakman changed the title aws: download nodeup from private S3 buckets with curl WIP aws: download nodeup from private S3 buckets with curl Aug 2, 2026
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 2, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zetaab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from olemarkus and zetaab August 2, 2026 09:54
@kubernetes-prow kubernetes-prow Bot added area/api area/documentation area/provider/aws Issues or PRs related to aws provider labels Aug 2, 2026
hakman added 5 commits August 2, 2026 14:31
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.
@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api area/documentation area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant