-
Notifications
You must be signed in to change notification settings - Fork 93
Runtime checks around providerID #228
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
Conversation
@jbornemann is this an OKE cluster or ?? The way this gets set is via the |
The check for the hostname label is as follows
Does your node name match that check? @prydie should be able to give context on that check as I can't remember why it exists (i think for OKE). If possible you should never rely on this though as you'll start to run into potential api rate limiting problems with OCI as your cluster grows, which is less likely with the provider id option. |
This is not OKE. It should pass that check, which is why I am confused. The provider-id flag, is that something I need to set on kubelets? provider-type is set to external per instructions. |
Had assumed it would get that value at runtime per ExternalName() or..sorry, forget the function call at the moment |
Sorry you're right the node controller will check w/ the cloud if provider id is empty string. Same check applies though above, so if it's not gonna pass the hostname prefix check on the node name then it won't work :) |
Mind pasting the output of |
Also, what version of the CCM are you running? Is the node in the same compartment as the networking components (vcn/subnet)? |
HostnameLabel is just the hostname right? Not the FQDN? If it was the FQDN, I suppose that would require it to be
To work :/ |
Correct, hostname label is not the fqdn. In order to get that you have to combine the hostname label, subnet dns label and vcn dns label. |
Setting it helps in various ways. If you set that value then there's no "guess work" that has to be done by the CCM. It's also more efficient and will ultimately lead to less rate limiting problems. You can do that via something like the following on the kubelet.
We should update the docs to mention setting this explicitly. We kinda do right now but in a not great way. |
pkg/oci/util/util.go
Outdated
} | ||
return providerID | ||
return providerID, errors.Errorf("(%q) is not a valid provider ID", providerID) |
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.
This would be a breaking change for existing deployments since it's optional to have the prefix which is how other clouds work as well. You can't actually run multiple CCMs in a single cluster across clouds.
I think a better check would be if empty string return 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.
Also, once the provider id is set you cannot change it so every node without the prefix would need to be deleted and register again w/ the cluster to fix it.
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.
Oh, wasn't aware of that. Thanks. Will change
0.5.0
No, those are managed in a separate compartment
I recently added oci as a provider to kubespray. Branch out, not merged. No smarts around provider-id yet, for any provider. May do it at some point, but for now just trying to get stable, automated, clusters. |
Some more details: Using principal auth. Authorizations for the dynamic group is as follows:
|
a2d7d43
to
89b3fba
Compare
@prydie @owainlewis something i noticed trying to help debug this is we're adding the call stack to every error but we're not logging the errors verbosely so it's basically useless :/. |
Changes made btw @jhorwit2 Also got the load balancers up and running! |
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.
LGTM (w/ one minor suggestion).
pkg/oci/load_balancer.go
Outdated
@@ -148,7 +148,15 @@ func getSubnetsForNodes(ctx context.Context, nodes []*v1.Node, client client.Int | |||
continue | |||
} | |||
|
|||
id := util.MapProviderIDToInstanceID(node.Spec.ProviderID) | |||
if node.Spec.ProviderID == "" { | |||
return nil, errors.Errorf("ProviderID was not present on node %q", node.Name) |
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.
Perhaps use the json path of ProviderID as the error is user facing:
return nil, errors.Errorf(".spec.providerID was not present on node %q", node.Name)
32dae68
to
268ec2e
Compare
@prydie Done. Thanks |
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.
@jhorwit2 can you give it another quick glance and accept the changes if you're happy?
@jbornemann Do you mind rebasing your branch as it's now conflicting? |
268ec2e
to
ecbd92e
Compare
@prydie rebased |
* Runtime checks around providerID * Added additional required authorization for security lists to example
This provides a bit more error detection around problems that could arise with providerID.
I am still trying to find out the source of why providerID is not being set on my cluster :
My instance names are not the same as my node names, however it should properly fall back to and correspond with my private subnet hostname label. Ideas?