-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
cloudprovider: add instance id to NodeSpec #4383
Conversation
@@ -673,6 +673,8 @@ type Minion struct { | |||
Status NodeStatus `json:"status,omitempty" description:"current status of node"` | |||
// Labels for the node | |||
Labels map[string]string `json:"labels,omitempty" description:"map of string keys and values that can be used to organize and categorize minions; labels of a minion assigned by the scheduler must match the scheduled pod's nodeSelector"` | |||
// External ID of the node assigned by the cloud provider |
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.
Given that we run in physical machine settings too, do we want something more generic than "cloud provider"? Perhaps:
"External ID of the node assigned by some machine database (e.g. a cloud provider)"
@bgrant0607 for API thoughts. This seems reasonable to me, but I'd prefer to land it with implementations for AWS and GCE (if not OpenStack and Vagrant) |
Re. API:
|
eecddeb
to
8406f1f
Compare
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/. If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits. Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name. |
@bgrant0607 I implemented all the cloud providers but I guess I'll need other people's help to test them. I could verify just the ovirt one. |
I'm punting at Brendan - I am out the second half of this week and crazy slammed the first half. |
I'll test on vagrant after #4468 merges. |
@bgrant0607 I'd prefer to keep ExternalID in Status vs Spec because I assume that a node can change ExternalID (e.g. vm cloned / decommissioned, etc.). |
@simon3z A node shouldn't be able to change ExternalID. That would be a new node object. That said, Spec is updatable. Status must be 100% automatically reconstructable from other sources, and shouldn't be provided by the cluster administrator. Does ExternalID meet that requirement? |
224c28e
to
21b31bf
Compare
@bgrant0607 I moved it to Spec |
API LGTM. Thanks. What happens for providers for which this is not implemented? FYI, maintainers are here: @derekwaynecarr for Vagrant |
@bgrant0607 if it's not implemented the error message (if any) is logged and the externalId won't be reported. Returning an empty string (and nil error) would be OK for providers that don't intend to expose the id. |
So it looks like we're heading for a pattern where we add lots of methods to the cloud provider, where each method extracts one piece of information. My inclination would have been a pattern where we have a "GetInfo" call, which just gathers all the information. This seems like it would be more efficient (particularly as we start to collect more and more information) and simpler. The AWS code looks fine, though I haven't tested it. |
I think I generally agree with @justinsb on the GetInfo call, but the whole cloud provider stuff needs a refactor anyway, so I'm not going to block the PR on that. Merging. |
21b31bf
to
14b16f7
Compare
Sounds good. |
This patch adds the support for returning the ip address of the instances when reported by the guest-agent and from the rest-api. Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Sometimes for external applications it is important to identify the cloud instance of the nodes. Until this patch there was no contract that the node name returned by List was also the unique identifier of the cloud instance. This new API ensures that an external application can reliably retrieve the relevant instance id of the nodes. Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
14b16f7
to
b942b1c
Compare
cloudprovider: add instance id to NodeSpec
@brendandburns if you agree with the GetInfo call refactoring I can start to work on that tomorrow (my final goal is to add another information and it seems that having separate class is not sustainable anymore). Thanks! |
@brendandburns can you check my last question? do you have an answer for that? |
Sometimes for external applications it is important to identify the cloud instance of the nodes. Until this patch there was no contract that the node name returned by List was also the unique identifier of the cloud instance. This new API ensures that an external application can reliably retrieve the relevant instance id of the nodes.