-
Notifications
You must be signed in to change notification settings - Fork 261
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
🌱 Templates: Set provider ID for flatcar directly via kubelet #1564
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lentzi90 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 think @pierreprinetti might be working on a fix in afterburn. |
I am proposing coreos/afterburn#931 as a potential solution. |
Tested with @pierreprinetti patch and it works.
Note: we can update the template with: name: $${COREOS_OPENSTACK_HOSTNAME}
kubeletExtraArgs:
- provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_ID}
+ provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_UUID}
initConfiguration:
nodeRegistration:
name: $${COREOS_OPENSTACK_HOSTNAME}
kubeletExtraArgs:
- provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_ID}
+ provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_UUID}
format: ignition
ignition:
containerLinuxConfig:
@@ -45,7 +45,7 @@ spec:
EnvironmentFile=/run/metadata/flatcar
preKubeadmCommands:
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
- - export COREOS_OPENSTACK_INSTANCE_ID=$${COREOS_OPENSTACK_INSTANCE_ID%.*}
+ - export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID}
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
---
@@ -60,10 +60,10 @@ spec:
nodeRegistration:
name: $${COREOS_OPENSTACK_HOSTNAME}
kubeletExtraArgs:
- provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_ID}
+ provider-id: openstack:///$${COREOS_OPENSTACK_INSTANCE_UUID}
preKubeadmCommands:
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
- - export COREOS_OPENSTACK_INSTANCE_ID=$${COREOS_OPENSTACK_INSTANCE_ID%.*}
+ - export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID}
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
format: ignition |
b6a02fc
to
b7055ab
Compare
Updated! |
This commit sets the provider ID in the flatcar templates. To avoid issues with potential mismatches between node names and openstack servers we can configure the kubelet to set the provider ID. Otherwise, the cloud controller will try to match nodes and servers based on just the name. The names can differ because of special characters, like dots. When this happens, the cloud controller will be unable to match them and thus believe that the node has no underlying server. Co-authored-by: Mathieu Tortuyaux <[email protected]>
b7055ab
to
070314e
Compare
@lentzi90 yeah! That was a great collaboration across open-source projects 🚀 For Flatcar, there is this tracking issue regarding Afterburn upgrade: flatcar/Flatcar#1049 |
Sounds good! There is no rush for me to get this in so we can wait 🙂 |
@lentzi90: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
name: $${COREOS_OPENSTACK_HOSTNAME} | ||
preKubeadmCommands: | ||
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} | ||
- export COREOS_OPENSTACK_INSTANCE_ID=$${COREOS_OPENSTACK_INSTANCE_ID%.*} |
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.
- export COREOS_OPENSTACK_INSTANCE_ID=$${COREOS_OPENSTACK_INSTANCE_ID%.*} | |
- export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID} |
(it would explain the failing CI)
EDIT: I wrongly commented on the template, this comment applies on the kustomize section of course
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.
I think the CI is failing because the flatcar image doesn't have the afterburn changes yet? But anyway, I can of course fix this
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.
Aha yes indeed. Sorry I thought the CI was using the image provided above 🤦
name: $${COREOS_OPENSTACK_HOSTNAME} | ||
preKubeadmCommands: | ||
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} | ||
- export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID%.*} |
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.
- export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID%.*} | |
- export COREOS_OPENSTACK_INSTANCE_UUID=$${COREOS_OPENSTACK_INSTANCE_UUID} |
@mdbooth thanks for the heads-up. It did not fall down in a crack: we were just waiting for Afterburn upgrade which has been done last week: flatcar/Flatcar#1049 and it should be available directly from Beta. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale the Afterburn change is now on Stable, we should be able to merge this PR after updating the Flatcar tested version to 3815.2.0 EDIT: Flatcar upgrade here: #1936 |
Superseeded by #1936 |
Thanks! |
What this PR does / why we need it:
This commit sets the provider ID in the flatcar templates. To avoid issues with potential mismatches between node names and openstack servers we can configure the kubelet to set the provider ID. Otherwise, the cloud controller will try to match nodes and servers based on just the name. The names can differ because of special characters, like dots. When this happens, the cloud controller will be unable to match them and thus believe that the node has no underlying server.
This was split out from #1551
Afterburn issue: coreos/afterburn#930
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #1547
Special notes for your reviewer:
TODOs:
/hold