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 30, 2024
1 parent 6e900bf commit 54079ff
Show file tree
Hide file tree
Showing 11 changed files with 364 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Files:
go.mod
go.sum
hack/*
pkg/ignition/template.yaml
pkg/ignition/ignition.tmpl
Copyright: 2024 SAP SE or an SAP affiliate company and IronCore contributors
License: Apache-2.0

Expand Down
2 changes: 2 additions & 0 deletions cmd/machine-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
mcmoptions "github.com/gardener/machine-controller-manager/pkg/util/provider/app/options"
_ "github.com/gardener/machine-controller-manager/pkg/util/reflector/prometheus" // for reflector metric registration
_ "github.com/gardener/machine-controller-manager/pkg/util/workqueue/prometheus" // for workqueue metric registration
ipamv1alpha1 "github.com/ironcore-dev/ipam/api/ipam/v1alpha1"
"github.com/ironcore-dev/machine-controller-manager-provider-metal/pkg/metal"
metalv1alpha1 "github.com/ironcore-dev/metal-operator/api/v1alpha1"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -71,6 +72,7 @@ func getMetalClientAndNamespace() (client.Client, string, error) {
utilruntime.Must(scheme.AddToScheme(s))
utilruntime.Must(corev1.AddToScheme(s))
utilruntime.Must(metalv1alpha1.AddToScheme(s))
utilruntime.Must(ipamv1alpha1.AddToScheme(s))

kubeconfigData, err := os.ReadFile(KubeconfigPath)
if err != nil {
Expand Down
77 changes: 77 additions & 0 deletions docs/provider-spec.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
## Specification
### ProviderSpec Schema
<br>
<h3 id="settings.gardener.cloud/v1alpha1.AddressesFromNetworks">
<b>AddressesFromNetworks</b>
</h3>
<p>
(<em>Appears on:</em>
<a href="#?id=%23settings.gardener.cloud%2fv1alpha1.ProviderSpec">ProviderSpec</a>)
</p>
<p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>key</code>
</td>
<td>
<em>
string
</em>
</td>
<td>
<p>Key is the name of metadata key for the network.</p>
</td>
</tr>
<tr>
<td>
<code>subnetRef</code>
</td>
<td>
<em>
<a href="#?id=https%3a%2f%2fkubernetes.io%2fdocs%2freference%2fgenerated%2fkubernetes-api%2fv1.29%2f%23localobjectreference-v1-core">
Kubernetes core/v1.LocalObjectReference
</a>
</em>
</td>
<td>
<p>SubnetRef is a reference to the IP subnet.</p>
</td>
</tr>
</tbody>
</table>
<br>
<h3 id="settings.gardener.cloud/v1alpha1.ProviderSpec">
<b>ProviderSpec</b>
</h3>
Expand Down Expand Up @@ -111,6 +160,34 @@ map[string]string
<p>ServerLabels are passed to the ServerClaim to find a server with certain properties</p>
</td>
</tr>
<tr>
<td>
<code>metaData</code>
</td>
<td>
<em>
map[string]any
</em>
</td>
<td>
<p>MedaData is a key-value map of additional data which should be passed to the Machine.</p>
</td>
</tr>
<tr>
<td>
<code>addressesFromNetworks</code>
</td>
<td>
<em>
<a href="#?id=%23settings.gardener.cloud%2fv1alpha1.AddressesFromNetworks">
[]AddressesFromNetworks
</a>
</em>
</td>
<td>
<p>AddressesFromNetworks is a list of LocalObjectReferences to Network resources that should be used to assign IP addresses to the worker nodes.</p>
</td>
</tr>
</tbody>
</table>
<hr/>
Expand Down
77 changes: 42 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
module github.com/ironcore-dev/machine-controller-manager-provider-metal

go 1.22.5
go 1.23.0

toolchain go1.23.1

require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/coreos/butane v0.23.0
github.com/gardener/machine-controller-manager v0.55.0
github.com/imdario/mergo v0.3.16
github.com/ironcore-dev/controller-utils v0.9.4
github.com/ironcore-dev/ipam v0.2.3-0.20241224180207-ced9fe647b76
github.com/ironcore-dev/metal-operator v0.0.0-20240710090642-501a0daa1610
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.1
github.com/onsi/ginkgo/v2 v2.22.1
github.com/onsi/gomega v1.36.2
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
k8s.io/component-base v0.31.0
k8s.io/api v0.32.0
k8s.io/apimachinery v0.32.0
k8s.io/client-go v0.32.0
k8s.io/component-base v0.32.0
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.130.1
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/controller-runtime v0.19.3
sigs.k8s.io/yaml v1.4.0
)

Expand All @@ -37,64 +40,68 @@ require (
github.com/coreos/ignition/v2 v2.20.0 // indirect
github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/vincent-petithory/dataurl v1.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/apiserver v0.31.0 // indirect
k8s.io/apiextensions-apiserver v0.32.0 // indirect
k8s.io/apiserver v0.32.0 // indirect
k8s.io/cluster-bootstrap v0.31.0 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
)
Loading

0 comments on commit 54079ff

Please sign in to comment.