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

cloud provider for alibaba doesn't work if providerid is not set in kubelet and not exists in node spec at beginning. #278

Closed
shaoyongfeng opened this issue Feb 18, 2022 · 5 comments

Comments

@shaoyongfeng
Copy link

Cloud provider for alibaba cloud just assume providerid exists in node spec when reconciling the node https://github.com/kubernetes/cloud-provider-alibaba-cloud/blob/master/pkg/controller/node/node_controller.go#L135-L138
But --provider-id is optional flag and will be deprecated in new kubenetes version

Dec 13 21:32:32 iZgw87uepwv66jorfgr1cmZ kubelet[2841]: Flag --provider-id has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.

If you look at the implementation of cloud provider for other hyperscaler, if providerid is not set by kubelet in node spec, it will try to get it based on node name and set it back to node spec
https://github.com/kubernetes/cloud-provider/blob/master/controllers/node/node_controller.go#L531-L540

So, please also enhance alibaba cloud provider to support similar functionality

@shaoyongfeng shaoyongfeng changed the title doesn't work of providerid is not set in kubelet and not exists in node spec at beginning. cloud provider for alibaba doesn't work if providerid is not set in kubelet and not exists in node spec at beginning. Feb 18, 2022
@gujingit
Copy link
Contributor

Yes, it's by design. The cloud controller manager for Alibaba relies on node.spec.providerid to identify the ecs. Alibaba supports users to customize nodename according to application, so we can not to get provider id from the node name.

Also, we will use the conf file to set providerid instead of --provider-id flag.

@jiangytcn
Copy link

Yes, it's by design. The cloud controller manager for Alibaba relies on node.spec.providerid to identify the ecs. Alibaba supports users to customize nodename according to application, so we can not to get provider id from the node name.

Also, we will use the conf file to set providerid instead of --provider-id flag.

hi @gujingit Is there any ETA for conf file feature ?

@shaoyongfeng
Copy link
Author

Hi @jiangytcn ,
Although ali supports user to customize node name, the name will still be reflected in ali cosole and become the name of ECS. In. that case, you still can get ECS by name and then get the instance id.
Actually aws also support customize node name and they handle the case if providerid doesn't exist in node spec

Regards,
Taylor

@gujingit
Copy link
Contributor

gujingit commented Feb 22, 2022

@shaoyongfeng We can not get provoiderID from node name. 1) Nodename is set by user which can be duplicated, so we may get multiple instances by node name. 2) In some cases, the providerID should be empty, e.g. edge node/ hybrid node. We should not set the providerID for these nodes.

@gujingit
Copy link
Contributor

fixed in pr #282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants