Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/onmetal-api-net/${{ matrix.image.name }}
ghcr.io/${{ github.repository_owner }}/ironcore-net/${{ matrix.image.name }}
tags: |
type=semver,pattern={{version}}
type=schedule
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# onmetal-api maintainers
* @onmetal/onmetal-api-maintainers
# ironcore-net maintainers
* @ironcore-dev/core
89 changes: 48 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate rbac objects.
# onmetal-api-net
# ironcore-net
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers/..." output:rbac:artifacts:config=config/controller/rbac

# apinetlet
Expand All @@ -60,8 +60,8 @@ manifests: controller-gen ## Generate rbac objects.
$(CONTROLLER_GEN) rbac:roleName=apinet-role paths="./metalnetlet/controllers/..." output:rbac:artifacts:config=config/metalnetlet/apinet-rbac

# Promote *let roles.
./hack/promote-let-role.sh config/apinetlet/apinet-rbac/role.yaml config/apiserver/rbac/apinetlet_role.yaml apinet.api.onmetal.de:system:apinetlets
./hack/promote-let-role.sh config/metalnetlet/apinet-rbac/role.yaml config/apiserver/rbac/metalnetlet_role.yaml apinet.api.onmetal.de:system:metalnetlets
./hack/promote-let-role.sh config/apinetlet/apinet-rbac/role.yaml config/apiserver/rbac/apinetlet_role.yaml apinet.ironcore.dev:system:apinetlets
./hack/promote-let-role.sh config/metalnetlet/apinet-rbac/role.yaml config/apiserver/rbac/metalnetlet_role.yaml apinet.ironcore.dev:system:metalnetlets

.PHONY: generate
generate: vgopath models-schema deepcopy-gen client-gen lister-gen informer-gen defaulter-gen conversion-gen openapi-gen applyconfiguration-gen
Expand All @@ -79,26 +79,26 @@ generate: vgopath models-schema deepcopy-gen client-gen lister-gen informer-gen

.PHONY: add-license
add-license: addlicense ## Add license headers to all go files.
find . -name '*.go' -exec $(ADDLICENSE) -c 'OnMetal authors' {} +
find . -name '*.go' -exec $(ADDLICENSE) -c 'IronCore authors' {} +

.PHONY: fmt
fmt: goimports ## Run goimports against code.
$(GOIMPORTS) -w .

.PHONY: check-license
check-license: addlicense ## Check that every file has a license header present.
find . -name '*.go' -exec $(ADDLICENSE) -check -c 'OnMetal authors' {} +
find . -name '*.go' -exec $(ADDLICENSE) -check -c 'IronCore authors' {} +

.PHONY: lint
lint: ## Run golangci-lint against code.
golangci-lint run ./...
lint: golangci-lint ## Run golangci-lint on the code.
$(GOLANGCI_LINT) run ./...

.PHONY: clean
clean: ## Clean any artifacts that can be regenerated.
rm -rf client-go/applyconfigurations
rm -rf client-go/informers
rm -rf client-go/listers
rm -rf client-go/onmetalapi
rm -rf client-go/ironcorenet
rm -rf client-go/openapi

.PHONY: check
Expand All @@ -115,16 +115,16 @@ test-only: envtest ## Only run tests.
.PHONY: openapi-extractor
extract-openapi: envtest openapi-extractor
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" $(OPENAPI_EXTRACTOR) \
--apiserver-package="github.com/onmetal/onmetal-api-net/cmd/apiserver" \
--apiserver-package="github.com/ironcore-dev/ironcore-net/cmd/apiserver" \
--apiserver-build-opts=mod \
--apiservices="./config/apiserver/apiservice/bases" \
--output="./gen"

##@ Build

.PHONY: build-onmetal-api-net
build-onmetal-api-net: generate fmt addlicense lint ## Build onmetal-api-net binary.
go build -o bin/manager ./onmetal-api-net/main.go
.PHONY: build-ironcore-net
build-ironcore-net: generate fmt addlicense lint ## Build ironcore-net binary.
go build -o bin/manager ./ironcore-net/main.go

.PHONY: build-apinetlet
build-apinetlet: generate fmt addlicense lint ## Build apinetlet.
Expand All @@ -135,11 +135,11 @@ build-metalnetlet: generate fmt addlicense lint ## Build metalnetlet.
go build -o bin/metalnetlet ./metalnetlet/main.go

.PHONY: build
build: build-onmetal-api-net build-apinetlet build-metalnetlet ## Build onmetal-api-net, apinetlet, metalnetlet.
build: build-ironcore-net build-apinetlet build-metalnetlet ## Build ironcore-net, apinetlet, metalnetlet.

.PHONY: run-onmetal-api-net
run-onmetal-api-net: manifests generate fmt lint ## Run a onmetal-api-net from your host.
go run ./onmetal-api-net/main.go
.PHONY: run-ironcore-net
run-ironcore-net: manifests generate fmt lint ## Run a ironcore-net from your host.
go run ./ironcore-net/main.go

.PHONY: run-apinetlet
run-apinetlet: manifests generate fmt lint ## Run apinetlet from your host.
Expand Down Expand Up @@ -185,17 +185,17 @@ docker-push-metalnetlet: ## Push metalnetlet image.
docker push ${METALNETLET_IMG}

.PHONY: docker-push
docker-push: docker-push-apiserver docker-push-controller-manager docker-push-apinetlet docker-push-metalnetlet ## Push onmetal-api-net, apinetlet, metalnetlet image.
docker-push: docker-push-apiserver docker-push-controller-manager docker-push-apinetlet docker-push-metalnetlet ## Push ironcore-net, apinetlet, metalnetlet image.

##@ Deployment

.PHONY: install-onmetal-api-net
install-onmetal-api-net: manifests ## Install onmetal-api-net CRDs into the K8s cluster specified in ~/.kube/config.
kubectl apply -k config/onmetal-api-net/crd
.PHONY: install-ironcore-net
install-ironcore-net: manifests ## Install ironcore-net CRDs into the K8s cluster specified in ~/.kube/config.
kubectl apply -k config/ironcore-net/crd

.PHONY: uninstall-onmetal-api-net
uninstall-onmetal-api-net: manifests ## Uninstall onmetal-api-net CRDs from the K8s cluster specified in ~/.kube/config.
kubectl delete-k config/onmetal-api-net/crd
.PHONY: uninstall-ironcore-net
uninstall-ironcore-net: manifests ## Uninstall ironcore-net CRDs from the K8s cluster specified in ~/.kube/config.
kubectl delete-k config/ironcore-net/crd

.PHONY: install-apinetlet
install-apinetlet: manifests ## Install apinetlet CRDs into the K8s cluster specified in ~/.kube/config.
Expand All @@ -214,15 +214,15 @@ uninstall-metalnetlet: manifests ## Uninstall metalnetlet CRDs from the K8s clus
kubectl delete-k config/metalnetlet/crd

.PHONY: install
install: install-onmetal-api-net install-apinetlet install-metalnetlet ## Uninstall onmetal-api-net, apinetlet, metalnetlet.
install: install-ironcore-net install-apinetlet install-metalnetlet ## Uninstall ironcore-net, apinetlet, metalnetlet.

.PHONY: uninstall
uninstall: uninstall-onmetal-api-net uninstall-apinetlet uninstall-metalnetlet ## Uninstall onmetal-api-net, apinetlet, metalnetlet.
uninstall: uninstall-ironcore-net uninstall-apinetlet uninstall-metalnetlet ## Uninstall ironcore-net, apinetlet, metalnetlet.

.PHONY: deploy-onmetal-api-net
deploy-onmetal-api-net: manifests kustomize ## Deploy onmetal-api-net controller to the K8s cluster specified in ~/.kube/config.
cd config/onmetal-api-net/manager && $(KUSTOMIZE) edit set image controller=${ONMETAL_API_NET_IMG}
kubectl apply -k config/onmetal-api-net/default
.PHONY: deploy-ironcore-net
deploy-ironcore-net: manifests kustomize ## Deploy ironcore-net controller to the K8s cluster specified in ~/.kube/config.
cd config/controller/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_MANAGER_IMG}
kubectl apply -k config/ironcore-net/default

.PHONY: deploy-apinetlet
deploy-apinetlet: manifests kustomize ## Deploy apinetlet controller to the K8s cluster specified in ~/.kube/config.
Expand All @@ -235,11 +235,11 @@ deploy-metalnetlet: manifests kustomize ## Deploy metalnetlet controller to the
kubectl apply -k config/metalnetlet/default

.PHONY: deploy
deploy: deploy-onmetal-api-net deploy-apinetlet deploy-metalnetlet ## Deploy onmetal-api-net, apinetlet, metalnetlet
deploy: deploy-ironcore-net deploy-apinetlet deploy-metalnetlet ## Deploy ironcore-net, apinetlet, metalnetlet

.PHONY: undeploy-onmetal-api-net
undeploy-onmetal-api-net: ## Undeploy onmetal-api-net controller from the K8s cluster specified in ~/.kube/config.
kubectl delete -k config/onmetal-api-net
.PHONY: undeploy-ironcore-net
undeploy-ironcore-net: ## Undeploy ironcore-net controller from the K8s cluster specified in ~/.kube/config.
kubectl delete -k config/ironcore-net

.PHONY: undeploy-apinetlet
undeploy-apinetlet: ## Undeploy apinetlet controller from the K8s cluster specified in ~/.kube/config.
Expand All @@ -250,7 +250,7 @@ undeploy-metalnetlet: ## Undeploy metalnetlet controller from the K8s cluster sp
kubectl delete -k config/metalnetlet

.PHONY: undeploy
undeploy: undeploy-onmetal-api-net undeploy-apinetlet undeploy-metalnetlet ## Undeploy onmetal-api-net, apinetlet, metalnetlet controller from the K8s cluster specified in ~/.kube/config.
undeploy: undeploy-ironcore-net undeploy-apinetlet undeploy-metalnetlet ## Undeploy ironcore-net, apinetlet, metalnetlet controller from the K8s cluster specified in ~/.kube/config.

##@ Kind Deployment plumbing

Expand All @@ -275,11 +275,11 @@ kind-load: kind-load-apiserver kind-load-controller-manager ## Load apiserver, c

.PHONY: kind-restart-apiserver
kind-restart-apiserver: ## Restarts the apiserver.
kubectl -n onmetal-api-net-system delete rs -l control-plane=apiserver
kubectl -n ironcore-net-system delete rs -l control-plane=apiserver

.PHONY: kind-restart-controller-manager
kind-restart-controller-manager: ## Restarts the controller-manager.
kubectl -n onmetal-api-net-system delete rs -l control-plane=controller-manager
kubectl -n ironcore-net-system delete rs -l control-plane=controller-manager

.PHONY: kind-restart-apinetlet
kind-restart-apinetlet: ## Restarts the apinetlet controller manager.
Expand Down Expand Up @@ -320,7 +320,7 @@ kind-apply: manifests ## Apply config/kind to the cluster specified in ~/.kube/c
kubectl apply -k config/kind

.PHONY: kind-deploy
kind-deploy: kind-build-load-restart kind-apply ## Build, load and restart onmetal-api-net and apinetlet and apply them.
kind-deploy: kind-build-load-restart kind-apply ## Build, load and restart ironcore-net and apinetlet and apply them.

.PHONY: kind-delete
kind-delete: ## Delete config/kind from the cluster specified in ~/.kube/config.
Expand Down Expand Up @@ -359,15 +359,17 @@ GEN_CRD_API_REFERENCE_DOCS ?= $(LOCALBIN)/gen-crd-api-reference-docs
ADDLICENSE ?= $(LOCALBIN)/addlicense
MODELS_SCHEMA ?= $(LOCALBIN)/models-schema
GOIMPORTS ?= $(LOCALBIN)/goimports
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint

## Tool Versions
KUSTOMIZE_VERSION ?= v5.1.1
CODE_GENERATOR_VERSION ?= v0.28.2
VGOPATH_VERSION ?= v0.1.1
CODE_GENERATOR_VERSION ?= v0.28.4
VGOPATH_VERSION ?= v0.1.3
CONTROLLER_TOOLS_VERSION ?= v0.13.0
GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0
ADDLICENSE_VERSION ?= v1.1.1
GOIMPORTS_VERSION ?= v0.13.0
GOLANGCI_LINT_VERSION ?= v1.55.2

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down Expand Up @@ -433,7 +435,7 @@ $(VGOPATH): $(LOCALBIN)
echo "$(LOCALBIN)/vgopath version is not expected $(VGOPATH_VERSION). Removing it before installing."; \
rm -rf $(LOCALBIN)/vgopath; \
fi
test -s $(LOCALBIN)/vgopath || GOBIN=$(LOCALBIN) go install github.com/onmetal/vgopath@$(VGOPATH_VERSION)
test -s $(LOCALBIN)/vgopath || GOBIN=$(LOCALBIN) go install github.com/ironcore-dev/vgopath@$(VGOPATH_VERSION)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
Expand All @@ -458,9 +460,14 @@ $(ADDLICENSE): $(LOCALBIN)
.PHONY: models-schema
models-schema: $(MODELS_SCHEMA) ## Install models-schema locally if necessary.
$(MODELS_SCHEMA): $(LOCALBIN)
test -s $(LOCALBIN)/models-schema || GOBIN=$(LOCALBIN) go install github.com/onmetal/onmetal-api-net/models-schema
test -s $(LOCALBIN)/models-schema || GOBIN=$(LOCALBIN) go install github.com/ironcore-dev/ironcore-net/models-schema

.PHONY: goimports
goimports: $(GOIMPORTS) ## Download goimports locally if necessary.
$(GOIMPORTS): $(LOCALBIN)
test -s $(LOCALBIN)/goimports || GOBIN=$(LOCALBIN) go install golang.org/x/tools/cmd/goimports@$(GOIMPORTS_VERSION)

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# onmetal-api-net
[![Pull Request Code test](https://github.com/onmetal/onmetal-api-net/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/onmetal/onmetal-api-net/actions/workflows/test.yml)
# ironcore-net

[![Pull Request Code test](https://github.com/ironcore-dev/ironcore-net/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/ironcore-dev/ironcore-net/actions/workflows/test.yml)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
[![GitHub License](https://img.shields.io/static/v1?label=License&message=Apache-2.0&color=blue&style=flat-square)](LICENSE)

## Overview

`onmetal-api-net` provides networking functions across multiple
`ironcore-net` provides networking functions across multiple
peers.

`onmetal-api-net` conceptually consists of a control-plane and
`Node`s. The API of `onmetal-api-net` is realized by an aggregated API
`ironcore-net` conceptually consists of a control-plane and
`Node`s. The API of `ironcore-net` is realized by an aggregated API
server. The `controller-manager` reconciles state of these objects.
The `scheduler` (currently built into the `controller-manager`)
assigns functions to `Node`s.
Expand All @@ -19,11 +20,11 @@ using a `metalnet` cluster run the payload functions on. A
`metalnetlet` creates `Node` objects corresponding to all
`Node`s inside the `metalnet` custer.

The integration to `onmetal-api` is realized via the `apinetlet`,
an agent using an `onmetal-api-net` cluster to realize `onmetal-api`
The integration to `ironcore` is realized via the `apinetlet`,
an agent using an `ironcore-net` cluster to realize `ironcore`
objects like `LoadBalancer`s, `VirtualIP`s and more.

Documentation about the concepts of `onmetal-api-net` can be found
Documentation about the concepts of `ironcore-net` can be found
in the [`concepts` directory](docs/concepts).

## Contributing
Expand Down
12 changes: 6 additions & 6 deletions api/core/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 OnMetal authors
// Copyright 2022 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,19 +15,19 @@
package v1alpha1

const (
ReconcileRequestAnnotation = "reconcile.apinet.api.onmetal.de/requestedAt"
ReconcileRequestAnnotation = "reconcile.apinet.ironcore.dev/requestedAt"

// APINetletsGroup is the system rbac group all apinetlets are in.
APINetletsGroup = "apinet.api.onmetal.de:system:apinetlets"
APINetletsGroup = "apinet.ironcore.dev:system:apinetlets"

// APINetletUserNamePrefix is the prefix all apinetlet users should have.
APINetletUserNamePrefix = "apinet.api.onmetal.de:system:apinetlet:"
APINetletUserNamePrefix = "apinet.ironcore.dev:system:apinetlet:"

// MetalnetletsGroup is the system rbac group all metalnetlets are in.
MetalnetletsGroup = "apinet.api.onmetal.de:system:metalnetlets"
MetalnetletsGroup = "apinet.ironcore.dev:system:metalnetlets"

// MetalnetletUserNamePrefix is the prefix all metalnetlet users should have.
MetalnetletUserNamePrefix = "apinet.api.onmetal.de:system:metalnetlet:"
MetalnetletUserNamePrefix = "apinet.ironcore.dev:system:metalnetlet:"
)

// APINetletCommonName constructs the common name for a certificate of an apinetlet user.
Expand Down
2 changes: 1 addition & 1 deletion api/core/v1alpha1/daemonset_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 OnMetal authors
// Copyright 2023 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions api/core/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 by the OnMetal authors.
* Copyright (c) 2021 by the IronCore authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +k8s:protobuf-gen=package
// +groupName=core.apinet.api.onmetal.de
// +groupName=core.apinet.ironcore.dev

// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1 // import "github.com/onmetal/onmetal-api-net/api/core/v1alpha1"
package v1alpha1 // import "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1"
4 changes: 2 additions & 2 deletions api/core/v1alpha1/instance_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 OnMetal authors
// Copyright 2023 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
package v1alpha1

import (
"github.com/onmetal/onmetal-api-net/apimachinery/api/net"
"github.com/ironcore-dev/ironcore-net/apimachinery/api/net"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
4 changes: 2 additions & 2 deletions api/core/v1alpha1/ip_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 OnMetal authors
// Copyright 2023 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
package v1alpha1

import (
"github.com/onmetal/onmetal-api-net/apimachinery/api/net"
"github.com/ironcore-dev/ironcore-net/apimachinery/api/net"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down
4 changes: 2 additions & 2 deletions api/core/v1alpha1/ipaddress_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 OnMetal authors
// Copyright 2023 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
package v1alpha1

import (
"github.com/onmetal/onmetal-api-net/apimachinery/api/net"
"github.com/ironcore-dev/ironcore-net/apimachinery/api/net"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
Expand Down
4 changes: 2 additions & 2 deletions api/core/v1alpha1/loadbalancer_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 OnMetal authors
// Copyright 2023 IronCore authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
package v1alpha1

import (
"github.com/onmetal/onmetal-api-net/apimachinery/api/net"
"github.com/ironcore-dev/ironcore-net/apimachinery/api/net"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
Loading