Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
74804ce
Add crd and controller for BMCSettings
nagadeesh-nagaraja Apr 3, 2025
4e23cb7
change name to bmcSettings
nagadeesh-nagaraja Apr 15, 2025
34f2c5b
Add reset bmc, improve controller logic
nagadeesh-nagaraja Apr 23, 2025
71cf437
skip some lint check temporarily
nagadeesh-nagaraja Apr 24, 2025
f131000
Improve documentation for bmcSettings
nagadeesh-nagaraja Apr 24, 2025
23d1414
Update design to accomodate difference vedor variations
nagadeesh-nagaraja Apr 28, 2025
6e8e476
merge conflict after rebase
nagadeesh-nagaraja May 8, 2025
00baa72
request for maintenance all the time
nagadeesh-nagaraja May 9, 2025
4aea0b4
Merge with latest Unit test helpers
nagadeesh-nagaraja May 23, 2025
851b693
expected merge changes with BIOSVersion CRD PR
nagadeesh-nagaraja May 27, 2025
0182085
Fix naming convenctions, factor out code and fix comments
nagadeesh-nagaraja May 27, 2025
e5343e4
Use requeAfter instead of reconcile error
nagadeesh-nagaraja May 27, 2025
ba84abc
Resolve merge conflicts with main
nagadeesh-nagaraja May 28, 2025
3468544
Change naming to ServerMaintenanceRefItem
nagadeesh-nagaraja May 28, 2025
13a1421
Merge branch 'main' into bmcSetting
nagadeesh-nagaraja Jun 5, 2025
9ffd502
resolve merge conflict with merge
nagadeesh-nagaraja Jun 5, 2025
d6f055f
regenerate genereted files
nagadeesh-nagaraja Jun 5, 2025
19fe67d
some code improvements
nagadeesh-nagaraja Jun 23, 2025
0ad0a39
remove unwanted comments and newlines
nagadeesh-nagaraja Jun 24, 2025
3019d87
Add webhook for `BMCSettings` resources (#322)
nagadeesh-nagaraja Jun 24, 2025
eddad77
Update the serverMaintenanceRef API field
nagadeesh-nagaraja Jun 24, 2025
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
11 changes: 11 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,15 @@ resources:
webhooks:
validation: true
webhookVersion: v1
- api:
crdVersion: v1
controller: true
domain: ironcore.dev
group: metal
kind: BMCSettings
path: github.com/ironcore-dev/metal-operator/api/v1alpha1
version: v1alpha1
webhooks:
validation: true
webhookVersion: v1
version: "3"
11 changes: 11 additions & 0 deletions api/v1alpha1/bmc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ const (
// BMCSpec defines the desired state of BMC
// +kubebuilder:validation:XValidation:rule="has(self.access) != has(self.endpointRef)",message="exactly one of access or endpointRef needs to be set"
type BMCSpec struct {

// bmcUUID is the unique identifier for the BMC as defined in REDFISH API.
// +kubebuilder:validation:Optional
// +optional
// This field is optional and can be omitted, controller will choose the first avaialbe Manager
BMCUUID string `json:"bmcUUID,omitempty"`

// EndpointRef is a reference to the Kubernetes object that contains the endpoint information for the BMC.
// This reference is typically used to locate the BMC endpoint within the cluster.
// +optional
Expand All @@ -49,6 +56,10 @@ type BMCSpec struct {
// This field is optional and can be omitted if console access is not required.
// +optional
ConsoleProtocol *ConsoleProtocol `json:"consoleProtocol,omitempty"`

// BMCSettingRef is a reference to a BMCSettings object that specifies
// the BMC configuration for this BMC.
BMCSettingRef *v1.LocalObjectReference `json:"bmcSettingsRef,omitempty"`
}

// InlineEndpoint defines inline network access configuration for the BMC.
Expand Down
89 changes: 89 additions & 0 deletions api/v1alpha1/bmcsettings_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// BMCSettings refer's to Out-Of-Band_management like IDrac for Dell, iLo for HPE etc Settings

// BMCSettingsSpec defines the desired state of BMCSettings.
type BMCSettingsSpec struct {
// Version contains BMC version this settings applies to
// +required
Version string `json:"version"`

// SettingsMap contains bmc settings as map
// +optional
SettingsMap map[string]string `json:"settings,omitempty"`

// BMCRef is a reference to a specific BMC to apply setting to.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverRef is immutable"
BMCRef *corev1.LocalObjectReference `json:"BMCRef,omitempty"`

// ServerMaintenancePolicy is maintenance policy to be enforced on the server when applying setting.
// ServerMaintenancePolicyOwnerApproval is asking for User approval for changing BMC settings
// note: User approval is only enforced for server's which are reserved state
// ServerMaintenancePolicyEnforced will will bypass user approval and apply setting directly
ServerMaintenancePolicy ServerMaintenancePolicy `json:"serverMaintenancePolicy,omitempty"`

// ServerMaintenanceRefs are references to a ServerMaintenance objects that Controller has requested for the each of the related server.
ServerMaintenanceRefs []ServerMaintenanceRefItem `json:"serverMaintenanceRefs,omitempty"`
}

type ServerMaintenanceRefItem struct {
ServerMaintenanceRef *corev1.ObjectReference `json:"serverMaintenanceRef,omitempty"`
}

// ServerMaintenanceState specifies the current state of the server maintenance.
type BMCSettingsState string

const (
// BMCSettingsStatePending specifies that the BMC maintenance is waiting
BMCSettingsStatePending BMCSettingsState = "Pending"
// BMCSettingsStateInProgress specifies that the BMC setting changes are in progress
BMCSettingsStateInProgress BMCSettingsState = "InProgress"
// BMCSettingsStateApplied specifies that the BMC maintenance has been completed.
BMCSettingsStateApplied BMCSettingsState = "Applied"
// BMCSettingsStateFailed specifies that the BMC maintenance has failed.
BMCSettingsStateFailed BMCSettingsState = "Failed"
)

// BMCSettingsStatus defines the observed state of BMCSettings.
type BMCSettingsStatus struct {
// State represents the current state of the BMC configuration task.
State BMCSettingsState `json:"state,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="BMCVersion",type=string,JSONPath=`.spec.bmcSettings.version`
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
// +kubebuilder:printcolumn:name="BMCRef",type=string,JSONPath=`.spec.BMCRef.name`
// +kubebuilder:printcolumn:name="ServerRef",type=string,JSONPath=`.spec.serverRef.name`

// BMCSettings is the Schema for the BMCSettings API.
type BMCSettings struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec BMCSettingsSpec `json:"spec,omitempty"`
Status BMCSettingsStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// BMCSettingsList contains a list of BMCSettings.
type BMCSettingsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []BMCSettings `json:"items"`
}

func init() {
SchemeBuilder.Register(&BMCSettings{}, &BMCSettingsList{})
}
133 changes: 133 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading
Loading