Skip to content

Commit

Permalink
worker metadata and ipam
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Dec 26, 2024
1 parent 63238c3 commit 44e1e31
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 0 deletions.
117 changes: 117 additions & 0 deletions hack/api-reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,45 @@ LoadBalancerConfig
</tr>
</tbody>
</table>
<h3 id="metal.provider.extensions.gardener.cloud/v1alpha1.AddressesFromNetworks">AddressesFromNetworks
</h3>
<p>
<p>AddressesFromNetworks is a reference to a network resource.</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>key</code></br>
<em>
string
</em>
</td>
<td>
<p>Key is the name of metadata key for the network.</p>
</td>
</tr>
<tr>
<td>
<code>subnetRef</code></br>
<em>
<a href="#metal.provider.extensions.gardener.cloud/v1alpha1.SubnetRef">
SubnetRef
</a>
</em>
</td>
<td>
<p>SubnetRef is a reference to the IP subnet.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="metal.provider.extensions.gardener.cloud/v1alpha1.BgpPeer">BgpPeer
</h3>
<p>
Expand Down Expand Up @@ -862,6 +901,58 @@ string
</tr>
</tbody>
</table>
<h3 id="metal.provider.extensions.gardener.cloud/v1alpha1.SubnetRef">SubnetRef
</h3>
<p>
(<em>Appears on:</em>
<a href="#metal.provider.extensions.gardener.cloud/v1alpha1.AddressesFromNetworks">AddressesFromNetworks</a>)
</p>
<p>
<p>SubnetRef is a reference to the IP subnet.</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>name</code></br>
<em>
string
</em>
</td>
<td>
<p>Name is the name of the network.</p>
</td>
</tr>
<tr>
<td>
<code>apiGroup</code></br>
<em>
string
</em>
</td>
<td>
<p>APIGroup is the group of the IP pool</p>
</td>
</tr>
<tr>
<td>
<code>kind</code></br>
<em>
string
</em>
</td>
<td>
<p>Kind is the kind of the IP pool</p>
</td>
</tr>
</tbody>
</table>
<h3 id="metal.provider.extensions.gardener.cloud/v1alpha1.WorkerConfig">WorkerConfig
</h3>
<p>
Expand Down Expand Up @@ -901,6 +992,32 @@ map[string]string
<p>ExtraServerLabels is a map of additional labels that are applied to the ServerClaim for Server selection.</p>
</td>
</tr>
<tr>
<td>
<code>addressesFromNetworks</code></br>
<em>
<a href="#metal.provider.extensions.gardener.cloud/v1alpha1.*github.com/ironcore-dev/gardener-extension-provider-metal/pkg/apis/metal/v1alpha1.AddressesFromNetworks">
[]*github.com/ironcore-dev/gardener-extension-provider-metal/pkg/apis/metal/v1alpha1.AddressesFromNetworks
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>AddressesFromNetworks is a list of references to Network resources that should be used to assign IP addresses to the worker nodes.</p>
</td>
</tr>
<tr>
<td>
<code>metaData</code></br>
<em>
map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>MedaData is a key-value map of additional data which should be passed to the Machine.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="metal.provider.extensions.gardener.cloud/v1alpha1.WorkerStatus">WorkerStatus
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/metal/types_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ type WorkerConfig struct {
ExtraIgnition *IgnitionConfig
// ExtraServerLabels is a map of extra labels that are applied to the ServerClaim for Server selection.
ExtraServerLabels map[string]string
// AddressesFromNetworks is a list of references to Network resources that should be used to assign IP addresses to the worker nodes.
AddressesFromNetworks []*AddressesFromNetworks
// MetaData is a key-value map of additional data which should be passed to the Machine.
MetaData map[string]string
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -52,3 +56,21 @@ type IgnitionConfig struct {
SecretRef *corev1.LocalObjectReference
Override bool
}

// SubnetRef is a reference to the IP subnet.
type SubnetRef struct {
// Name is the name of the network.
Name string
// APIGroup is the group of the IP pool
APIGroup string
// Kind is the kind of the IP pool
Kind string
}

// AddressesFromNetworks is a reference to a network resource.
type AddressesFromNetworks struct {
// Key is the name of metadata key for the network.
Key string
// SubnetRef is a reference to the IP subnet.
SubnetRef *SubnetRef
}
24 changes: 24 additions & 0 deletions pkg/apis/metal/v1alpha1/types_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ type WorkerConfig struct {
// ExtraServerLabels is a map of additional labels that are applied to the ServerClaim for Server selection.
// +optional
ExtraServerLabels map[string]string `json:"extraServerLabels,omitempty"`
// AddressesFromNetworks is a list of references to Network resources that should be used to assign IP addresses to the worker nodes.
// +optional
AddressesFromNetworks []*AddressesFromNetworks `json:"addressesFromNetworks,omitempty"`
// MedaData is a key-value map of additional data which should be passed to the Machine.
// +optional
MetaData map[string]string `json:"metaData,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -64,3 +70,21 @@ type IgnitionConfig struct {
// +optional
Override bool `json:"override,omitempty"`
}

// SubnetRef is a reference to the IP subnet.
type SubnetRef struct {
// Name is the name of the network.
Name string `json:"name"`
// APIGroup is the group of the IP pool
APIGroup string `json:"apiGroup"`
// Kind is the kind of the IP pool
Kind string `json:"kind"`
}

// AddressesFromNetworks is a reference to a network resource.
type AddressesFromNetworks struct {
// Key is the name of metadata key for the network.
Key string `json:"key"`
// SubnetRef is a reference to the IP subnet.
SubnetRef *SubnetRef `json:"subnetRef"`
}
70 changes: 70 additions & 0 deletions pkg/apis/metal/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions pkg/apis/metal/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 44e1e31

Please sign in to comment.