You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] set k8s node label to indicate physical machine #540
I can confirm that the hostID is available, and based on a quick test, I can also confirm that the hostID field in the VM details contains the unique hypervisor host identification (tested with the OSISM OpenStack Testbed):
Two of the three VMs have been created in the same hypervisor host testbed-node-0:
HostIDs for test-1 and test-2 VMs are the same, test-3 has a different one:
$ openstack server show test-1 -c name -c hostId
+--------+----------------------------------------------------------+
| Field | Value |
+--------+----------------------------------------------------------+
| hostId | e9c78f3c4e83f07f488ce2940e4be64a4b9064889554e9201b817d4d |
| name | test-1 |
+--------+----------------------------------------------------------+
$ openstack server show test-2 -c name -c hostId
+--------+----------------------------------------------------------+
| Field | Value |
+--------+----------------------------------------------------------+
| hostId | e9c78f3c4e83f07f488ce2940e4be64a4b9064889554e9201b817d4d |
| name | test-2 |
+--------+----------------------------------------------------------+
$ openstack server show test-3 -c name -c hostId
+--------+----------------------------------------------------------+
| Field | Value |
+--------+----------------------------------------------------------+
| hostId | 41e0aa102d80badf272692ebc58339a8c3f9032802d034148504fe83 |
| name | test-3 |
+--------+----------------------------------------------------------+
We discussed with @jschoone and @chess-knight regarding our next steps, given that there appears to be no clear decision from the upstream on where this implementation should take place. It does not seem realistic to push/merge this upstream before R6.
As a temporary workaround, we discussed the following:
Creating another script or extending the existing scs-0214-v1 script to be cloud-specific (openstack-specific).
Ensuring the script has access to the underlying OpenStack infrastructure.
Having the script retrieve the list of Host IDs and corresponding hostnames using the OpenStack API.
Validating k8s-node-distribution based on the label 'kubernetes.io/hostname' retrieved from the K8s API and information from step 3.
We need some label that has a 1:1 correspondence with the physical machines (at least when IaaS is not nested). And I think a hash of the project id and the actual hostname should work. We may run into a problem if somehow the nodes are distributed over multiple projects that share compute hosts, but I don't know if that is likely or even possible.
We need some label that has a 1:1 correspondence with the physical machines (at least when IaaS is not nested). And I think a hash of the project id and the actual hostname should work. We may run into a problem if somehow the nodes are distributed over multiple projects that share compute hosts, but I don't know if that is likely or even possible.
I never heard about the k8s cluster across multiple OpenStack projects(tenants)!
We need some label that has a 1:1 correspondence with the physical machines (at least when IaaS is not nested). And I think a hash of the project id and the actual hostname should work. We may run into a problem if somehow the nodes are distributed over multiple projects that share compute hosts, but I don't know if that is likely or even possible.
I never heard about the k8s cluster across multiple OpenStack projects(tenants)!
Had the same thoughts. Technical I think it's possible somehow, but we don't support it and we decide if someone builds it on their own it's on their own risk.
Where it's more likely in SCS context is when deploying Kubernetes clusters using interconnectivity. But then "topology.kubernetes.io/region" and/or "topology.kubernetes.io/zone" differs so we should be safe.
We reached a consensus that the optimal strategy is to tackle this issue upstream. While acknowledging previous efforts in this direction, we noted that it remains incomplete. Our plan is to provide contribution upstream to reach the resolution.
Simultaneously, we recognized the need for a functional Standard test for SCS KaaS v1 and V2. Consequently, we have decided to implement a pre-run job. This job will precede the SCS Standard test and utilize OpenStack CLI to fetch the hypervisor HostID. Afterwards, it will create a label on the Kubernetes node with the HostID, enabling recognition by the SCS Standard test.
The E2E pipeline for KaaS V1 has been adjusted.
It now includes the execution of both Kubernetes standards (anti-affinity and k8s version policy).
Additionally, it includes pre-standard tasks that label Kubernetes nodes before the anti-affinity standard (SCS-0214) is executed (see PR). The same for KaaS V2 is in progress.
I expect that after @mbuechse and @cah-hbaum make the necessary changes in both standard scripts, the E2E pipeline will work with little or no adjustments.
Also be aware that based on the discussion with @cah-hbaum and @chess-knight , we agreed that the custom k8s label for the hypervisor Host ID will be topology.scs.openstack.org/host-id. As we do not have a strong opinion here, any other proposals are welcomed.
Thanks for pushing this forward, this looks really good!
Also be aware that based on the discussion with @cah-hbaum and @chess-knight , we agreed that the custom k8s label for the hypervisor Host ID will be topology.scs.openstack.org/host-id. As we do not have a strong opinion here, any other proposals are welcomed.
Is this supposed to be a temporary label? Actually, even if it is, I would recommend using a domain that belongs to SCS for the label, so people encountering it can find us. For example: topology.scs.community/host-id.
Is this supposed to be a temporary label? Actually, even if it is, I would recommend using a domain that belongs to SCS for the label, so people encountering it can find us. For example: topology.scs.community/host-id.
Activity
matofeder commentedon Mar 6, 2024
I can confirm that the hostID is available, and based on a quick test, I can also confirm that the hostID field in the VM details contains the unique hypervisor host identification (tested with the OSISM OpenStack Testbed):
Two of the three VMs have been created in the same hypervisor host
testbed-node-0:HostIDs for test-1 and test-2 VMs are the same, test-3 has a different one:
We discussed with @jschoone and @chess-knight regarding our next steps, given that there appears to be no clear decision from the upstream on where this implementation should take place. It does not seem realistic to push/merge this upstream before R6.
As a temporary workaround, we discussed the following:
berendt commentedon Mar 6, 2024
We work a lot with live migrations in the infrastructure. How do we take this into account when we work with the hostId?
matofeder commentedon Mar 6, 2024
Wouldn't the
hostIdalso change in that case? If yes, I would say that the scs-0214-v1 script should work.mbuechse commentedon Mar 6, 2024
We need some label that has a 1:1 correspondence with the physical machines (at least when IaaS is not nested). And I think a hash of the project id and the actual hostname should work. We may run into a problem if somehow the nodes are distributed over multiple projects that share compute hosts, but I don't know if that is likely or even possible.
chess-knight commentedon Mar 7, 2024
I never heard about the k8s cluster across multiple OpenStack projects(tenants)!
chess-knight commentedon Mar 7, 2024
Some more reading:
jschoone commentedon Mar 7, 2024
Had the same thoughts. Technical I think it's possible somehow, but we don't support it and we decide if someone builds it on their own it's on their own risk.
Where it's more likely in SCS context is when deploying Kubernetes clusters using interconnectivity. But then "topology.kubernetes.io/region" and/or "topology.kubernetes.io/zone" differs so we should be safe.
matofeder commentedon Mar 11, 2024
Outcome of the meeting held on Friday, March 8, at 2:05 PM with attendees @jschoone, @mbuechse, @cah-hbaum, @chess-knight, and @matofeder:
We reached a consensus that the optimal strategy is to tackle this issue upstream. While acknowledging previous efforts in this direction, we noted that it remains incomplete. Our plan is to provide contribution upstream to reach the resolution.
Simultaneously, we recognized the need for a functional Standard test for SCS KaaS v1 and V2. Consequently, we have decided to implement a pre-run job. This job will precede the SCS Standard test and utilize OpenStack CLI to fetch the hypervisor HostID. Afterwards, it will create a label on the Kubernetes node with the HostID, enabling recognition by the SCS Standard test.
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
Add k8s node labels workaround
matofeder commentedon Mar 13, 2024
The E2E pipeline for KaaS V1 has been adjusted.
It now includes the execution of both Kubernetes standards (anti-affinity and k8s version policy).
Additionally, it includes pre-standard tasks that label Kubernetes nodes before the anti-affinity standard (SCS-0214) is executed (see PR). The same for KaaS V2 is in progress.
I expect that after @mbuechse and @cah-hbaum make the necessary changes in both standard scripts, the E2E pipeline will work with little or no adjustments.
Also be aware that based on the discussion with @cah-hbaum and @chess-knight , we agreed that the custom k8s label for the hypervisor Host ID will be
topology.scs.openstack.org/host-id. As we do not have a strong opinion here, any other proposals are welcomed.martinmo commentedon Mar 14, 2024
Thanks for pushing this forward, this looks really good!
Is this supposed to be a temporary label? Actually, even if it is, I would recommend using a domain that belongs to SCS for the label, so people encountering it can find us. For example:
topology.scs.community/host-id.matofeder commentedon Mar 14, 2024
It serves as a temporary label until upstream proposes and implements an alternative label/solution.
Regarding the name, I agree, see SovereignCloudStack/k8s-cluster-api-provider@ffb722b
matofeder commentedon Mar 18, 2024
FYI: A generic Kubernetes cloud provider implementation now supports the addition of additional cloud-specific labels. Consequently, the cloud provider OpenStack can utilize this interface to easily add labels such as the HostID label to the node. See the related comment for details: https://github.com/kubernetes/cloud-provider/issues/67
Add scs-0210-v2 and scs-0214-v1 zuul checks (#714)