Skip to content

Commit

Permalink
Align pxebootconfig controller with gardenlinux OCI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikdr committed Jan 27, 2025
1 parent dedc9f6 commit 981f6a4
Show file tree
Hide file tree
Showing 10 changed files with 391 additions and 73 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func main() {
var ipxeServiceProtocol string
var ipxeServicePort int
var imageServerURL string
var architecture string

flag.StringVar(&architecture, "architecture", "amd64", "Target system architecture (e.g., amd64, arm64)")
flag.IntVar(&ipxeServicePort, "ipxe-service-port", 5000, "IPXE Service port to listen on.")
flag.StringVar(&ipxeServiceProtocol, "ipxe-service-protocol", "http", "IPXE Service Protocol.")
flag.StringVar(&ipxeServiceURL, "ipxe-service-url", "", "IPXE Service URL.")
Expand Down Expand Up @@ -192,6 +194,7 @@ func main() {
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
IPXEServiceURL: ipxeServiceURL,
Architecture: architecture,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ServerBootConfigPxe")
os.Exit(1)
Expand Down
87 changes: 87 additions & 0 deletions config/crd/bases/metal.ironcore.dev_httpbootconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
name: httpbootconfigs.metal.ironcore.dev
spec:
group: metal.ironcore.dev
names:
kind: HTTPBootConfig
listKind: HTTPBootConfigList
plural: httpbootconfigs
singular: httpbootconfig
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HTTPBootConfig is the Schema for the httpbootconfigs API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: HTTPBootConfigSpec defines the desired state of HTTPBootConfig
properties:
ignitionSecretRef:
description: IgnitionSecretRef is a reference to the secret containing
Ignition configuration.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
systemIPs:
description: SystemIPs is a list of IP addresses assigned to the server.
items:
type: string
type: array
systemUUID:
description: SystemUUID is the unique identifier (UUID) of the server.
type: string
ukiURL:
description: UKIURL is the URL where the UKI (Unified Kernel Image)
is hosted.
type: string
type: object
status:
description: HTTPBootConfigStatus defines the observed state of HTTPBootConfig
properties:
state:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
119 changes: 119 additions & 0 deletions config/crd/bases/metal.ironcore.dev_ipxebootconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
name: ipxebootconfigs.metal.ironcore.dev
spec:
group: metal.ironcore.dev
names:
kind: IPXEBootConfig
listKind: IPXEBootConfigList
plural: ipxebootconfigs
singular: ipxebootconfig
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: IPXEBootConfig is the Schema for the ipxebootconfigs API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: IPXEBootConfigSpec defines the desired state of IPXEBootConfig
properties:
ignitionSecretRef:
description: IgnitionSecretRef is a reference to the secret containing
the Ignition configuration.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
image:
description: Image is deprecated and will be removed.
type: string
initrdURL:
description: InitrdURL is the URL where the Initrd (initial RAM disk)
of the OS is hosted, eg. the URL to the Initrd layer of the OS OCI
image.
type: string
ipxeScriptSecretRef:
description: IPXEScriptSecretRef is a reference to the secret containing
the custom IPXE script.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
ipxeServerURL:
description: IPXEServerURL is deprecated and will be removed.
type: string
kernelURL:
description: KernelURL is the URL where the kernel of the OS is hosted,
eg. the URL to the Kernel layer of the OS OCI image.
type: string
squashfsURL:
description: SquashfsURL is the URL where the Squashfs of the OS is
hosted, eg. the URL to the Squashfs layer of the OS OCI image.
type: string
systemIPs:
description: SystemIPs is a list of IP addresses assigned to the server.
items:
type: string
type: array
systemUUID:
description: SystemUUID is the unique identifier (UUID) of the server.
type: string
type: object
status:
description: IPXEBootConfigStatus defines the observed state of IPXEBootConfig
properties:
state:
description: 'Important: Run "make" to regenerate code after modifying
this file'
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
15 changes: 11 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/ironcore-dev/boot-operator
go 1.23.0

require (
github.com/containerd/containerd v1.7.25
github.com/coreos/butane v0.23.0
github.com/go-logr/logr v1.4.2
github.com/ironcore-dev/controller-utils v0.9.7
github.com/ironcore-dev/ironcore-image v0.2.4
github.com/ironcore-dev/metal v0.0.0-20240624131301-18385f342755
github.com/ironcore-dev/metal-operator v0.0.0-20241009145147-7ccca8caf3b1
github.com/onsi/ginkgo/v2 v2.22.2
Expand All @@ -20,12 +20,12 @@ require (
)

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clarketm/json v1.17.1 // indirect
github.com/containerd/containerd v1.7.23 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/coreos/go-json v0.0.0-20230131223807-18775e0fb4fb // indirect
Expand All @@ -36,8 +36,10 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
Expand All @@ -52,8 +54,9 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/moby/locker v1.0.1 // 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
Expand All @@ -69,6 +72,10 @@ require (
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/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric 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/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
Expand Down
Loading

0 comments on commit 981f6a4

Please sign in to comment.