-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add initial support for the Azure instance metadata service. #48243
Conversation
e947923
to
75c580b
Compare
@@ -29,6 +29,16 @@ import ( | |||
|
|||
// NodeAddresses returns the addresses of the specified instance. | |||
func (az *Cloud) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error) { | |||
if az.UseInstanceMetadata { | |||
text, err := QueryMetadataText("instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress") |
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.
if this errors, should it fall back to the previous API calls or return an error?
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.
the "where possible" language in the config option is squishy, so I wasn't sure
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.
Where possible was meant to mean: "where the metadata service provides the information" as opposed to "fallback if there are errors"
We don't fallback in other places where we use other metadata services:
https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/aws/aws.go#L779
So I think we probably don't want to here, either.
/sig azure |
LGTM, but out of curiosity, why implement the various networking structs if the only usage of the IMDS is to directly grab the relevant ipv4 needed and you never actually use/deserialize the containing structs? /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, colemickens Associated issue: 46632 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
I'm going to pull more eventually... (also eventually, I'll fork it out as it's own library) |
@@ -0,0 +1,103 @@ | |||
/* | |||
Copyright 2016 The Kubernetes Authors. |
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.
2017
Automatic merge from submit-queue (batch tested with PRs 48594, 47042, 48801, 48641, 48243) |
Part of fixing #46632
@colemickens @rootfs @jdumars @kris-nova