-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[OpenStack] Use new hash format in instance names #10557
Conversation
seems that tests will fail, I will fix tests tomorrow |
0173169
to
3e68591
Compare
@olemarkus @rifelpet could you guys help me here, why tests are failing? I cannot find the reason for that, some fields missing from dummy data? |
3e68591
to
9b11b99
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zetaab 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 |
I do not understand why its trying to create two instances with same name? If I add debug https://github.com/kubernetes/kops/blob/master/cloudmock/openstack/mockcompute/servers.go#L193 I can see that it will create two nodes always with same name!? Its not working like that when I execute it against real OpenStack |
Does that happen prior to this PR? I tried to duplicate that on master, but doesn't seem to happen there. |
Just wondering if |
hmm the metadata is set here https://github.com/kubernetes/kops/blob/master/cloudmock/openstack/mockcompute/servers.go#L199 ? |
b270349
to
6bb0b7c
Compare
6bb0b7c
to
185ccba
Compare
@olemarkus now it works! What is your opinion about this? Ping @mitch000001 |
I think this looks good. /lgtm |
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.
Overall looks good, just some minor naming issues :)
/hold In case you want to implement the requested changes |
looks good to me |
@olemarkus can you recheck (and remove hold if ok) |
@zetaab is that a change we want to also cherry-pick for 1.19? |
@mitch000001 no idea, do we want it already in 1.19? I am fine with that if someone wants it |
/hold cancel I think this needs to bake a while, so a bit too late for 1.19. |
Missed this one, but while upgrading to kops 1.20 from 1.19 on OpenStack I found out ;-) I understand this solves a problem, but it also means that the server name does not include the cluster name anymore. Meaning a quick |
I think the introduced change does more than just adding a hash to the name. The prior problem was that the server name also contained the order in the instance group, e.g. if the instance group has 3 members (size 3) then the first node was called |
Thanks @mitch000001 this makes a lot of sense now! |
So this will modify the instance name format that we will see in OpenStack instance names AND in Kubernetes cluster. The current problem that we have is that if we delete instance from OpenStack and run
kops update cluster --yes
- the new instance will come back with same name. However, the OpenStack instanceid is changed and it leads to problems (there is mismatch between Kubernetes API node instanceid and real OpenStack instanceid). The current way to fix this is to delete node from Kubernetes API and restart OpenStack instance.old format:
<ig name>-<index>-<clustername>
new format:
<ig name>-<6 chars random hash>
tested with following cases:
with new code
calc.k8s.local
kops update cluster --name calc.k8s.local
)kops update cluster --name calc.k8s.local
)kops rolling-update cluster calc.k8s.local --yes
)kops edit ig nodes-zone-2
&&kops update cluster --name calc.k8s.local
)with old code create and then updating with newer code
kops update cluster --name calc.k8s.local
)kops update cluster --name calc.k8s.local
)kops rolling-update cluster calc.k8s.local --yes
)kops edit ig nodes-zone-2
&&kops update cluster --name calc.k8s.local
)with old code create and then scaling down with new code
kops edit ig nodes-zone-2
&&kops update cluster --name calc.k8s.local
)this code is backward compatible with old clusters with old format