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
Jump to file
Failed to load files.
Loading
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 @@ -29,7 +29,7 @@ jobs:
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/ipxe-operator
ghcr.io/${{ github.repository_owner }}/boot-operator
tags: |
type=semver,pattern={{version}}
type=schedule
Expand Down
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ipxe-operator
Upstream-Name: boot-operator
Upstream-Contact: IronCore authors <ospo@sap.com>
Source: https://github.com/ironcore-dev/ipxe-operator
Source: https://github.com/ironcore-dev/boot-operator

# --------------------------------------------------
# source code
Expand Down
15 changes: 3 additions & 12 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,16 @@
domain: ironcore.dev
layout:
- go.kubebuilder.io/v4
projectName: ipxe-operator
repo: github.com/ironcore-dev/ipxe-operator
projectName: boot-operator
repo: github.com/ironcore-dev/boot-operator
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ironcore.dev
group: boot
kind: IPXEBootConfig
path: github.com/ironcore-dev/ipxe-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ironcore.dev
group: boot
kind: HTTPBootConfig
path: github.com/ironcore-dev/ipxe-operator/api/v1alpha1
path: github.com/ironcore-dev/boot-operator/api/v1alpha1
version: v1alpha1
version: "3"
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# ipxe-operator
# boot-operator

[![REUSE status](https://api.reuse.software/badge/github.com/ironcore-dev/ipxe-operator)](https://api.reuse.software/info/github.com/ironcore-dev/ipxe-operator)
[![Go Report Card](https://goreportcard.com/badge/github.com/ironcore-dev/ipxe-operator)](https://goreportcard.com/report/github.com/ironcore-dev/ipxe-operator)
[![REUSE status](https://api.reuse.software/badge/github.com/ironcore-dev/boot-operator)](https://api.reuse.software/info/github.com/ironcore-dev/boot-operator)
[![Go Report Card](https://goreportcard.com/badge/github.com/ironcore-dev/boot-operator)](https://goreportcard.com/report/github.com/ironcore-dev/boot-operator)
[![GitHub License](https://img.shields.io/static/v1?label=License&message=Apache-2.0&color=blue)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com)

The iPXE Operator is a Kubernetes controller designed to streamline the management of iPXE infrastructure within Kubernetes environments. This operator simplifies network booting processes by automating iPXE script generation and ignition content delivery based on Kubernetes Custom Resource Definitions (CRDs).
The Boot Operator is a Kubernetes controller designed to streamline the management of Boot infrastructure such as HTTPBoot within Kubernetes environments. This operator simplifies network booting processes by automating HTTPBoot UKI URL generation and ignition content delivery based on Kubernetes Custom Resource Definitions (CRDs).

## Key Components
- __IPXE HTTP Server__: Serves dynamic iPXE scripts and ignition content through HTTP endpoints, tailored to individual machine specifications.
- __HTTP Boot Server__: Serves dynamic HTTP Boot Responses and ignition content through HTTP endpoints, tailored to individual machine specifications.

- __Reconciler__: Configures the IPXE HTTP Server based on the desired state specified in `IPXEBootConfiguration` CRDs, ensuring the server's configuration aligns with cluster resources.
- __Reconciler__: Configures the HTTP Server based on the desired state specified in `HTTPBootConfig` CRs, ensuring the server's configuration aligns with cluster resources.

- __Translator (Optional)__: Converts `BootConfiguration` CustomResources from MetalAPI provided by `Ironcore` into the format expected by the iPXE Operator, enhancing integration capabilities.
- __Translator (Optional)__: Converts `BootConfig` CustomResources from MetalAPI provided by `Ironcore` into the format expected by the HTTPBoot Operator, enhancing integration capabilities.


## HTTP Server Endpoints
- `/ignition/{UUID}`: Matches an `IPXEBootConfiguration` using the provided `{UUID}` (Spec.systemUUID) and serves the associated ignition content.
- `/ignition/{UUID}`: Matches an `HTTPBootConfig` using the provided `{UUID}` (Spec.systemUUID) and serves the associated ignition content.

- `/ipxe`: Identifies the corresponding `IPXEBootConfiguration` based on the requester's system IP (Spec.SystemIP). It then renders the `templates/ipxe-script.tpl` with values from the CRD (e.g., KernelURL, InitrdURL, SquashfsURL) and returns the customized iPXE script.
- `/httpboot`: Identifies the corresponding `HTTPBootConfig` based on the requester's system IP (Spec.SystemIP). It then returns the customized UKIURL associated with the `HTTPBootConfig`.

## Getting Started

Expand All @@ -32,7 +32,7 @@ The iPXE Operator is a Kubernetes controller designed to streamline the manageme
**Build and push your image to the location specified by `IMG`:**

```sh
make docker-build docker-push IMG=<some-registry>/ipxe-operator:tag
make docker-build docker-push IMG=<some-registry>/boot-operator:tag
```

**NOTE:** This image ought to be published in the personal registry you specified.
Expand All @@ -48,7 +48,7 @@ make install
**Deploy the Manager to the cluster with the image specified by `IMG`:**

```sh
make deploy IMG=<some-registry>/ipxe-operator:tag
make deploy IMG=<some-registry>/boot-operator:tag
```

> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
Expand Down Expand Up @@ -89,7 +89,7 @@ Following are the steps to build the installer and distribute this project to us
1. Build the installer for the image built and published in the registry:

```sh
make build-installer IMG=<some-registry>/ipxe-operator:tag
make build-installer IMG=<some-registry>/boot-operator:tag
```

NOTE: The makefile target mentioned above generates an 'install.yaml'
Expand All @@ -102,7 +102,7 @@ its dependencies.
Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:

```sh
kubectl apply -f https://raw.githubusercontent.com/<org>/ipxe-operator/<tag or branch>/dist/install.yaml
kubectl apply -f https://raw.githubusercontent.com/<org>/boot-operator/<tag or branch>/dist/install.yaml
```

**NOTE:** Run `make help` for more information on all potential `make` targets
Expand All @@ -111,7 +111,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k


## Roadmap
Looking ahead, the iPXE Operator aims to introduce a range of enhancements to further empower Kubernetes-driven infrastructure provisioning:
Looking ahead, the boot-Operator aims to introduce a range of enhancements to further empower Kubernetes-driven infrastructure provisioning:

- Configurable iPXE Scripts: Enable customization of iPXE script templates to accommodate diverse booting requirements.

Expand Down
9 changes: 4 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

bootv1alpha1 "github.com/ironcore-dev/ipxe-operator/api/v1alpha1"
"github.com/ironcore-dev/ipxe-operator/internal/controller"
bootserver "github.com/ironcore-dev/ipxe-operator/server"
bootv1alpha1 "github.com/ironcore-dev/boot-operator/api/v1alpha1"
"github.com/ironcore-dev/boot-operator/internal/controller"
bootserver "github.com/ironcore-dev/boot-operator/server"
//+kubebuilder:scaffold:imports
)

Expand All @@ -41,7 +41,6 @@ var (

const (
// core controllers
serverBootConfigControllerPxe = "serverbootconfigpxe"
httpBootConfigController = "httpbootconfig"
serverBootConfigControllerHttp = "serverbootconfighttp"
)
Expand Down Expand Up @@ -69,7 +68,7 @@ func main() {
flag.StringVar(&imageServerURL, "image-server-url", "", "OS Image Server URL.")
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.StringVar(&bootserverAddr, "boot-server-address", ":8082", "The address the ipxe-server binds to.")
flag.StringVar(&bootserverAddr, "boot-server-address", ":8082", "The address the boot-server binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
Expand Down
2 changes: 0 additions & 2 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- path: patches/webhook_in_ipxebootconfigs.yaml
#- path: patches/webhook_in_httpbootconfigs.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- path: patches/cainjection_in_ipxebootconfigs.yaml
#- path: patches/cainjection_in_httpbootconfigs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: ipxe-operator-system
namespace: boot-operator-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: ipxe-operator-
namePrefix: boot-operator-

# Labels to add to all resources and selectors.
#labels:
Expand Down
8 changes: 4 additions & 4 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: system
---
Expand All @@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
spec:
selector:
Expand Down
4 changes: 2 additions & 2 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_client_clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: metrics-reader
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: proxy-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: proxy-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/httpbootconfig_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: httpbootconfig-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: httpbootconfig-editor-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/httpbootconfig_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: httpbootconfig-viewer-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: httpbootconfig-viewer-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager-sa
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/created-by: boot-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
4 changes: 2 additions & 2 deletions config/samples/httpbootconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
labels:
app.kubernetes.io/name: httpbootconfig
app.kubernetes.io/instance: httpbootconfig-sample
app.kubernetes.io/part-of: ipxe-operator
app.kubernetes.io/part-of: boot-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: ipxe-operator
app.kubernetes.io/created-by: boot-operator
name: httpbootconfig-sample
spec:
systemUUID: 1234
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ironcore-dev/ipxe-operator
module github.com/ironcore-dev/boot-operator

go 1.22.2

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/httpbootconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/go-logr/logr"
bootv1alpha1 "github.com/ironcore-dev/ipxe-operator/api/v1alpha1"
bootv1alpha1 "github.com/ironcore-dev/boot-operator/api/v1alpha1"
)

// HTTPBootConfigReconciler reconciles a HTTPBootConfig object
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/httpbootconfig_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

bootv1alpha1 "github.com/ironcore-dev/ipxe-operator/api/v1alpha1"
bootv1alpha1 "github.com/ironcore-dev/boot-operator/api/v1alpha1"
)

var _ = Describe("HTTPBootConfig Controller", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"strings"

"github.com/go-logr/logr"
"github.com/ironcore-dev/ipxe-operator/api/v1alpha1"
bootv1alpha1 "github.com/ironcore-dev/ipxe-operator/api/v1alpha1"
bootv1alpha1 "github.com/ironcore-dev/boot-operator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -115,7 +114,7 @@ func (r *ServerBootConfigurationHTTPReconciler) reconcile(ctx context.Context, l
return ctrl.Result{}, nil
}

func (r *ServerBootConfigurationHTTPReconciler) patchConfigStateFromHTTPState(ctx context.Context, httpBootConfig *v1alpha1.HTTPBootConfig, config *metalv1alpha1.ServerBootConfiguration) error {
func (r *ServerBootConfigurationHTTPReconciler) patchConfigStateFromHTTPState(ctx context.Context, httpBootConfig *bootv1alpha1.HTTPBootConfig, config *metalv1alpha1.ServerBootConfiguration) error {
if httpBootConfig.Status.State == bootv1alpha1.HTTPBootConfigStateReady {
return r.patchState(ctx, config, metalv1alpha1.ServerBootConfigurationStateReady)
}
Expand Down Expand Up @@ -175,6 +174,6 @@ func (r *ServerBootConfigurationHTTPReconciler) constructUKIURL(image string) (s
func (r *ServerBootConfigurationHTTPReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&metalv1alpha1.ServerBootConfiguration{}).
Owns(&v1alpha1.HTTPBootConfig{}).
Owns(&bootv1alpha1.HTTPBootConfig{}).
Complete(r)
}
Loading