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

Set IMDSv2 as optional #4274

Merged
merged 1 commit into from
May 19, 2023
Merged

Conversation

wyike
Copy link
Contributor

@wyike wyike commented May 17, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:
IMDSv2 enablement in #4037 is a breaking change. We need give customer time to migrate their applications.

This PR set IMDSv2 as optional as the default to not break existing customers. The instance will be the same instance metadata options as before after capa upgraded:

        httpPutResponseHopLimit: 1
        httpTokens: optional

Customer can still customize instance metadata option themselves by configuring in the awsmachinetemplate/instanceMetadataOptions.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #4275

Special notes for your reviewer:
In future, if we want to enable IMDSv2 as default, we switch to below default values:

        httpPutResponseHopLimit: 2
        httpTokens: required

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Defaults to configure instance metadata with IMDSv2 optional

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label May 17, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 17, 2023
@wyike wyike marked this pull request as draft May 17, 2023 15:38
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 18, 2023
@wyike wyike force-pushed the disable-imdsv2 branch 2 times, most recently from 97664e9 to b888f63 Compare May 18, 2023 02:22
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 18, 2023
@wyike wyike marked this pull request as ready for review May 18, 2023 02:22
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 18, 2023
@k8s-ci-robot k8s-ci-robot requested a review from shivi28 May 18, 2023 02:22
@wyike
Copy link
Contributor Author

wyike commented May 18, 2023

/test pull-cluster-api-provider-aws-e2e

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 18, 2023
@wyike
Copy link
Contributor Author

wyike commented May 18, 2023

/test pull-cluster-api-provider-aws-e2e

@Skarlso
Copy link
Contributor

Skarlso commented May 19, 2023

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Skarlso

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit b568361 into kubernetes-sigs:main May 19, 2023
@wyike
Copy link
Contributor Author

wyike commented May 22, 2023

/cherry-pick release-2.1

@k8s-infra-cherrypick-robot

@wyike: #4274 failed to apply on top of branch "release-2.1":

Applying: Default IMDSv2 to optional
.git/rebase-apply/patch:222: trailing whitespace.
Before you decide to use IMDSv2 for the cluster instances, please make sure all your applications are compatible to IMDSv2. 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	api/v1beta2/awsmachinetemplate_webhook_test.go
M	api/v1beta2/types.go
M	controllers/awsmachine_controller_unit_test.go
M	docs/book/src/topics/instance-metadata.md
Falling back to patching base and 3-way merge...
Auto-merging docs/book/src/topics/instance-metadata.md
CONFLICT (content): Merge conflict in docs/book/src/topics/instance-metadata.md
Auto-merging controllers/awsmachine_controller_unit_test.go
CONFLICT (content): Merge conflict in controllers/awsmachine_controller_unit_test.go
Auto-merging api/v1beta2/types.go
Auto-merging api/v1beta2/awsmachinetemplate_webhook_test.go
CONFLICT (content): Merge conflict in api/v1beta2/awsmachinetemplate_webhook_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Default IMDSv2 to optional
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-2.1

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/test-infra repository.

@wyike
Copy link
Contributor Author

wyike commented May 22, 2023

/cherry-pick release-2.1

@k8s-infra-cherrypick-robot

@wyike: new pull request created: #4281

In response to this:

/cherry-pick release-2.1

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CAPA default imdsv2 breaks existing clusters
4 participants