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
Create a Cluster using Metal3DataTemplate and IPPool
Check the owner references on the IPAddress, IPClaim, Metal3Data, Metal3DataClaim and BareMetalHost
The Metal3Data owns the IPAddress and IPClaim (and the IPClaim owns the IPAddress). The Metal3Machine owns the BareMetalHost, Metal3DataClaim and Metal3Data (and the Metal3DataClaim owns the Metal3Data).
This owner structure seems quite strange and unnecessary. Why should the Metal3Machine own the Metal3Data for example when it already owns the Metal3DataClaim? And why should it own the BareMetalHost that is most likely created by the user?
These relations makes it harder to reason about behaviors and understanding the structure.
The owner references are usually used to delete owned objects when the owner is deleted. Owning both the parent and child, like is the case with the IPClaim and IPAddress, is not necessary and can lead to surprising behaviors.
What did you expect to happen:
The owner chain should not have situations where the grand parent owns both parent and child.
We should not put owner references on objects lightly. In general they belong on objects created from or managed by the owner, that should be deleted when the owner is deleted.
Anything else you would like to add:
There may be reasons for the structure that we have, but I have not been able to find them.
The main goal with this issue is to think critically about the structure we have, and think about if/how we can improve it.
What steps did you take and what happened:
This owner structure seems quite strange and unnecessary. Why should the Metal3Machine own the Metal3Data for example when it already owns the Metal3DataClaim? And why should it own the BareMetalHost that is most likely created by the user?
These relations makes it harder to reason about behaviors and understanding the structure.
The owner references are usually used to delete owned objects when the owner is deleted. Owning both the parent and child, like is the case with the IPClaim and IPAddress, is not necessary and can lead to surprising behaviors.
What did you expect to happen:
The owner chain should not have situations where the grand parent owns both parent and child.
We should not put owner references on objects lightly. In general they belong on objects created from or managed by the owner, that should be deleted when the owner is deleted.
Anything else you would like to add:
There may be reasons for the structure that we have, but I have not been able to find them.
The main goal with this issue is to think critically about the structure we have, and think about if/how we can improve it.
Here is a (WIP) graph of the relations:
--- title: Cluster API and Metal3 objects --- erDiagram Cluster ||--|| KubeadmControlPlane : references Cluster ||--|| Metal3Cluster : references Cluster ||--o{ MachineDeployment : owns MachineDeployment ||--|| KubeadmConfigTemplate : references KubeadmControlPlane ||--|| Metal3MachineTemplate : references Metal3MachineTemplate ||--o| Metal3DataTemplate : references Metal3MachineTemplate ||--o{ Metal3Machine : spawns Metal3DataTemplate }o--o{ IPPool : references IPPool }o--|| Cluster : references KubeadmControlPlane ||--|{ Machine : spawns MachineDeployment ||--|{ Machine : spawns KubeadmConfigTemplate ||--o{ KubeadmConfig : spawns Machine ||--|| Metal3Machine : owns Machine ||--|| KubeadmConfig : owns Metal3Machine |o--o| Metal3DataClaim : owns Metal3Machine |o--o| Metal3Data : owns Metal3Machine ||--|| BareMetalHost : consumes Metal3DataTemplate ||--o{ Metal3Data : spawns Metal3DataClaim ||--|| Metal3Data : consumes Metal3Data |o--o{ IPClaim : owns Metal3Data ||--o{ IPAddress : owns IPPool ||--o{ IPAddress : spawns IPClaim ||--|| IPAddress : consumes %% Secrets Metal3Data ||--|| Secret_metadata : produces Metal3Data ||--|| Secret_networkdata : produces KubeadmConfig ||--|| Secret_userdata : produces Secret_userdata ||--|| BareMetalHost : configures Secret_metadata ||--|| BareMetalHost : configures Secret_networkdata ||--|| BareMetalHost : configuresEnvironment:
kubectl version): v1.28.3/kind bug