Skip to content

Commit

Permalink
Add controller for ironcore-metal
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Jan 21, 2025
1 parent 124c213 commit a75c0b2
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 163 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
deployments/test
deployments/cluster.yaml
deployments/secret.yaml
build/

15 changes: 14 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,28 @@ def deploy_bmo_crd():
cmd = "curl -sSL {} | kubectl apply -f -".format(m3_uri)
local(cmd, quiet=False)

def deploy_metal_crd():
version = "9a29dae0cfa4575cc94b3c9d9643e441cea7ef9b"
bmcSecret_uri = "https://raw.githubusercontent.com/ironcore-dev/metal-operator/{}/config/crd/bases/metal.ironcore.dev_bmcsecrets.yaml".format(version)
cmd_bmcSecret = "curl -sSL {} | kubectl apply -f -".format(bmcSecret_uri)
bmc_uri = "https://raw.githubusercontent.com/ironcore-dev/metal-operator/{}/config/crd/bases/metal.ironcore.dev_bmcs.yaml".format(version)
cmd_bmc = "curl -sSL {} | kubectl apply -f -".format(bmc_uri)
server_uri = "https://raw.githubusercontent.com/ironcore-dev/metal-operator/{}/config/crd/bases/metal.ironcore.dev_servers.yaml".format(version)
cmd = "curl -sSL {} | kubectl apply -f -".format(server_uri)
local(cmd_bmcSecret, quiet=False)
local(cmd_bmc, quiet=False)
local(cmd, quiet=False)

docker_build('argora-dev', '.', build_args={"BININFO_BUILD_DATE": config.parse()['BININFO_BUILD_DATE'], "BININFO_VERSION": config.parse()['BININFO_VERSION'], "BININFO_COMMIT_HASH": config.parse()['BININFO_COMMIT_HASH']})

deploy_cert_manager()
#deploy_capi_crd()
deploy_bmo_crd()
deploy_metal_crd()

k8s_yaml('deployments/cluster-api-components.yaml')
k8s_yaml('config/rbac/role.yaml')
k8s_yaml('deployments/argora.yaml')
k8s_yaml('deployments/test/cluster.yaml')
k8s_yaml('deployments/cluster.yaml')
k8s_yaml('deployments/secret.yaml')

9 changes: 2 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/*
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
* Vestibulum commodo. Ut rhoncus gravida arcu.
*/
// Copyright 2024 SAP SE
// SPDX-License-Identifier: Apache-2.0

package main

Expand Down
14 changes: 14 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ rules:
- patch
- update
- watch
- apiGroups:
- metal.ironcore.dev
resources:
- bmcs
- bmcsecrets
- servers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- metal3.io
resources:
Expand Down
5 changes: 4 additions & 1 deletion deployments/argora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
containers:
- name: argora
image: argora-dev:latest
args:
- --controllers="metal3Controller"
# - --controllers="ironCoreServerController"
envFrom:
- secretRef:
name: argora
name: argora
48 changes: 25 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
module github.com/sapcc/argora

go 1.23
go 1.23.0

require (
github.com/dspinhirne/netaddr-go/v2 v2.0.0
github.com/metal3-io/baremetal-operator/apis v0.6.1
github.com/sapcc/go-api-declarations v1.13.2
github.com/sapcc/go-netbox-go v0.0.0-20241106125215-07e3722fbd4d
github.com/spf13/cobra v1.8.0
k8s.io/api v0.30.1
github.com/spf13/cobra v1.8.1
k8s.io/api v0.31.4
sigs.k8s.io/cluster-api v1.7.2
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/controller-runtime v0.19.4
)

require (
github.com/ironcore-dev/controller-utils v0.9.7
github.com/ironcore-dev/metal-operator v0.0.0-20250110122403-9a29dae0cfa4
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.30.1
k8s.io/apimachinery v0.31.4
)

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // 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/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // 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/errors v0.20.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // 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
Expand All @@ -45,39 +48,38 @@ require (
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/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.5.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // 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/oklog/ulid v1.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/client-go v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/apiextensions-apiserver v0.31.4 // indirect
k8s.io/client-go v0.31.4 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // 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
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading

0 comments on commit a75c0b2

Please sign in to comment.