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

Increase IMDSv2 hop limit on control plane nodes #10702

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

olemarkus
Copy link
Member

Non-hostNetworking fails to talk to the instance metadata otherwise. Breaking e.g CSI controller

See kubernetes/cloud-provider-aws#169

Note: This should work for kubenet, but other CNIs may need other hop limits. E.g with Cilium, I had to use 3 to get this to work. Will have to investigate a bit more first. Meanwhile this should fix the broken test.

Non-hostNetworking fails to talk to the instance metadata otherwise. Breaking e.g CSI controller
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 31, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus

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 Jan 31, 2021
Comment on lines +682 to +684
g.Spec.InstanceMetadata = &api.InstanceMetadataOptions{
HTTPPutResponseHopLimit: fi.Int64(2),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check if HTTPPutResponseHopLimit is already set by user. Probably all this logic has to be updated a bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should be IMDSv2, if I'm not mistaken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only set hop limit if InstanceMetadata is nil, so user should not have set anything. IMDSv2 is used when httpTokens: required and this is set ... somewhere else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMDSv2 meant in title.
Here there is a case when HTTPTokens can be set, but HTTPPutResponseHopLimit won't be set. Would not happen in practice but code should be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal of this one was just to see if we can get the tests passing. We need to add more logic here soon to get CNI (well cilium anyway) working.

@olemarkus olemarkus changed the title Increase imdv2 hop limit on control plane nodes Increase IMDSv2 hop limit on control plane nodes Feb 1, 2021
@hakman
Copy link
Member

hakman commented Feb 1, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 1, 2021
@k8s-ci-robot k8s-ci-robot merged commit 31c8771 into kubernetes:master Feb 1, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Feb 1, 2021
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. 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.

None yet

3 participants