controller

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BIOSSettingsFinalizer = "metal.ironcore.dev/biossettings"

	BIOSServerMaintenanceConditionCreated       = "ServerMaintenanceCreated"
	BIOSServerMaintenanceReasonCreated          = "ServerMaintenanceHasBeenCreated"
	BIOSServerMaintenanceConditionDeleted       = "ServerMaintenanceDeleted"
	BIOSServerMaintenanceReasonDeleted          = "ServerMaintenanceHasBeenDeleted"
	BIOSVersionUpdateConditionPending           = "BIOSVersionUpdatePending"
	BIOSVersionUpgradeReasonPending             = "BIOSVersionNeedsTObeUpgraded"
	BIOSPendingSettingConditionCheck            = "BIOSSettingsCheckPendingSettings"
	BIOSPendingSettingsReasonFound              = "BIOSPendingSettingsFound"
	BIOSSettingsConditionDuplicateKey           = "BIOSSettingsDuplicateKeys"
	BIOSSettingsReasonFoundDuplicateKeys        = "BIOSSettingsDuplicateKeysFound"
	BIOSSettingConditionUpdateStartTime         = "BIOSSettingUpdateStartTime"
	BIOSSettingsReasonUpdateStartTime           = "BIOSSettingsUpdateHasStarted"
	BIOSSettingConditionUpdateTimedOut          = "BIOSSettingsTimedOut"
	BIOSSettingsReasonUpdateTimedOut            = "BIOSSettingsTimedOutDuringUpdate"
	BIOSSettingsConditionServerPowerOn          = "ServerPowerOnCondition"
	BIOSSettingsReasonServerPoweredOn           = "ServerPoweredHasBeenPoweredOn"
	BMCConditionReset                           = "BMCResetIssued"
	BMCReasonReset                              = "BMCResetIssued"
	BIOSSettingsConditionIssuedUpdate           = "SettingsUpdateIssued"
	BIOSSettingReasonIssuedUpdate               = "BIOSSettingUpdateIssued"
	BIOSSettingsConditionUnknownPendingSettings = "UnknownPendingSettingState"
	BIOSSettingsReasonUnexpectedPendingSettings = "UnexpectedPendingSettingsPostUpdateHasBeenIssued"
	BIOSSettingsConditionRebootPostUpdate       = "ServerRebootPostUpdateHasBeenIssued"
	BIOSSettingsReasonSkipReboot                = "SkipServerRebootPostUpdateHasBeenIssued"
	BIOSSettingsReasonRebootNeeded              = "RebootPostSettingUpdate"
	BIOSSettingsConditionRebootPowerOff         = "RebootPowerOff"
	BIOSSettingsReasonRebootServerPowerOff      = "PowerOffCompletedDuringReboot"
	BIOSSettingsConditionRebootPowerOn          = "RebootPowerOn"
	BIOSSettingsReasonRebootServerPowerOn       = "PowerOnCompletedDuringReboot"
	BIOSSettingsConditionVerifySettings         = "VerifySettingsPostUpdate"
	BIOSSettingsReasonVerificationCompleted     = "VerificationCompleted"
	BIOSSettingsConditionWrongSettings          = "SettingsProvidedNotValid"
	BIOSSettingsReasonWrongSettings             = "SettingsProvidedAreNotValid"
)
View Source
const (
	BIOSVersionFinalizer = "metal.ironcore.dev/biosversion"

	ConditionBIOSUpgradeIssued       = "BIOSUpgradeIssued"
	ConditionBIOSUpgradeCompleted    = "BIOSUpgradeCompleted"
	ConditionBIOSUpgradePowerOn      = "BIOSUpgradePowerOn"
	ConditionBIOSUpgradePowerOff     = "BIOSUpgradePowerOff"
	ConditionBIOSUpgradeVerification = "BIOSUpgradeVerification"

	ReasonUpgradeIssued           = "UpgradeIssued"
	ReasonUpgradeIssueFailed      = "UpgradeIssueFailed"
	ReasonRebootPowerOff          = "RebootPowerOff"
	ReasonRebootPowerOn           = "RebootPowerOn"
	ReasonBIOSVersionVerified     = "BIOSVersionVerified"
	ReasonBIOSVersionVerification = "BIOSVersionVerificationFailed"
	ReasonUpgradeTaskFailed       = "UpgradeTaskFailed"
	ReasonUpgradeTaskCompleted    = "UpgradeTaskCompleted"
)
View Source
const (
	BMCSettingFinalizer               = "metal.ironcore.dev/bmcsettings"
	BMCResetPostSettingApplyCondition = "BMCResetPostSettingApply"
	BMCPoweredOffCondition            = "BMCPoweredOff"
	BMCPoweredOffReason               = "BMCPowerIsCurrentlyPoweredOff"
	BMCVersionUpdatePendingCondition  = "BMCVersionUpdatePending"
	BMCVersionUpgradePendingReason    = "BMCVersionUpgradeIsPending"
)
View Source
const (
	// DefaultIgnitionSecretKeyName is the default key name for the ignition secret
	DefaultIgnitionSecretKeyName = "ignition"
	// DefaultIgnitionFormatKey is the key for the ignition format annotation
	DefaultIgnitionFormatKey = "format"
	// DefaultIgnitionFormatValue is the value for the ignition format annotation
	DefaultIgnitionFormatValue = "fcos"
	// SSHKeyPairSecretPrivateKeyName is the key name for the private key in the SSH key pair secret
	SSHKeyPairSecretPrivateKeyName = "pem"
	// SSHKeyPairSecretPublicKeyName is the key name for the public key in the SSH key pair secret
	SSHKeyPairSecretPublicKeyName = "pub"
	// SSHKeyPairSecretPasswordKeyName is the key name for the password in the SSH key pair secret
	SSHKeyPairSecretPasswordKeyName = "password"
	// ServerFinalizer is the finalizer for the server
	ServerFinalizer = "metal.ironcore.dev/server"
	// InternalAnnotationTypeKeyName is the key name for the internal annotation type
	InternalAnnotationTypeKeyName = "metal.ironcore.dev/type"
	// IsDefaultServerBootConfigOSImageKeyName is the key name for the is default OS image annotation
	IsDefaultServerBootConfigOSImageKeyName = "metal.ironcore.dev/is-default-os-image"
	// InternalAnnotationTypeValue is the value for the internal annotation type
	InternalAnnotationTypeValue = "Internal"
	// PoweringOnCondition is the condition type for powering on a server
	PoweringOnCondition = "PoweringOn"
)
View Source
const BIOSVersionSetFinalizer = "metal.ironcore.dev/biosversionset"
View Source
const (
	BMCFinalizer = "metal.ironcore.dev/bmc"
)
View Source
const BMCSettingsSetFinalizer = "metal.ironcore.dev/bmcsettingsset"
View Source
const BMCVersionSetFinalizer = "metal.ironcore.dev/bmcversionset"
View Source
const (
	EndpointFinalizer = "metal.ironcore.dev/endpoint"
)
View Source
const (
	ServerClaimFinalizer = "metal.ironcore.dev/serverclaim"
)
View Source
const (
	// ServerMaintenanceFinalizer is the finalizer for the ServerMaintenance resource.
	ServerMaintenanceFinalizer = "metal.ironcore.dev/servermaintenance"
)

Variables

This section is empty.

Functions

func GenerateRandomPassword

func GenerateRandomPassword(length int) ([]byte, error)

GenerateRandomPassword generates a random password of the given length.

func GetCondition added in v0.2.0

func GetCondition(acc *conditionutils.Accessor, conditions []metav1.Condition, conditionType string) (*metav1.Condition, error)

GetCondition finds a condition in a condition slice.

func GetImageCredentialsForSecretRef added in v0.2.0

func GetImageCredentialsForSecretRef(ctx context.Context, c client.Client, secretRef *corev1.SecretReference) (string, string, error)

func GetServerByName added in v0.2.0

func GetServerByName(ctx context.Context, c client.Client, serverName string) (*metalv1alpha1.Server, error)

GetServerByName returns a Server object by its name or an error in case the object can not be found.

func GetServerMaintenanceForObjectReference added in v0.2.0

func GetServerMaintenanceForObjectReference(ctx context.Context, c client.Client, ref *metalv1alpha1.ObjectReference) (*metalv1alpha1.ServerMaintenance, error)

GetServerMaintenanceForObjectReference returns a ServerMaintenance object for a given reference.

func RegisterIndexFields added in v0.2.0

func RegisterIndexFields(ctx context.Context, indexer client.FieldIndexer) error

Types

type BIOSSettingsReconciler added in v0.2.0

type BIOSSettingsReconciler struct {
	client.Client
	ManagerNamespace string
	Insecure         bool
	Scheme           *runtime.Scheme
	BMCOptions       bmc.Options
	ResyncInterval   time.Duration
	TimeoutExpiry    time.Duration
	Conditions       *conditionutils.Accessor
}

BIOSSettingsReconciler reconciles a BIOSSettings object

func (*BIOSSettingsReconciler) Reconcile added in v0.2.0

func (r *BIOSSettingsReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BIOSSettingsReconciler) SetupWithManager added in v0.2.0

func (r *BIOSSettingsReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BIOSSettingsSetReconciler

type BIOSSettingsSetReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BIOSSettingsSetReconciler reconciles a BIOSSettingsSet object

func (*BIOSSettingsSetReconciler) Reconcile

func (*BIOSSettingsSetReconciler) SetupWithManager

func (r *BIOSSettingsSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BIOSVersionReconciler

type BIOSVersionReconciler struct {
	client.Client
	ManagerNamespace string
	Insecure         bool
	Scheme           *runtime.Scheme
	BMCOptions       bmc.Options
	ResyncInterval   time.Duration
	Conditions       *conditionutils.Accessor
}

BIOSVersionReconciler reconciles a BIOSVersion object

func (*BIOSVersionReconciler) Reconcile

func (r *BIOSVersionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*BIOSVersionReconciler) SetupWithManager

func (r *BIOSVersionReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BIOSVersionSetReconciler

type BIOSVersionSetReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BIOSVersionSetReconciler reconciles a BIOSVersionSet object

func (*BIOSVersionSetReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BIOSVersionSetReconciler) SetupWithManager

func (r *BIOSVersionSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCReconciler

type BMCReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Insecure bool
	// BMCFailureResetDelay defines the duration after which a BMC will be reset upon repeated connection failures.
	BMCFailureResetDelay time.Duration
	BMCOptions           bmc.Options
	ManagerNamespace     string
	// BMCResetWaitTime defines the duration to wait after a BMC reset before attempting reconciliation again.
	BMCResetWaitTime time.Duration
	// BMCClientRetryInterval defines the duration to requeue reconciliation after a BMC client error/reset/unavailablility.
	BMCClientRetryInterval time.Duration
	// DNSRecordTemplatePath is the path to the file containing the DNSRecord template.
	DNSRecordTemplate string
	Conditions        *conditionutils.Accessor
}

BMCReconciler reconciles a BMC object

func (*BMCReconciler) Reconcile

func (r *BMCReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BMCReconciler) SetupWithManager

func (r *BMCReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCSecretReconciler

type BMCSecretReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BMCSecretReconciler reconciles a BMCSecret object

func (*BMCSecretReconciler) Reconcile

func (r *BMCSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the BMCSecret object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.17.0/pkg/reconcile

func (*BMCSecretReconciler) SetupWithManager

func (r *BMCSecretReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCSettingsReconciler

type BMCSettingsReconciler struct {
	client.Client
	ManagerNamespace string
	ResyncInterval   time.Duration
	Insecure         bool
	Scheme           *runtime.Scheme
	BMCOptions       bmc.Options
	Conditions       *conditionutils.Accessor
}

BMCSettingsReconciler reconciles a BMCSettings object

func (*BMCSettingsReconciler) Reconcile

func (r *BMCSettingsReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

func (*BMCSettingsReconciler) SetupWithManager

func (r *BMCSettingsReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCSettingsSetReconciler added in v0.2.0

type BMCSettingsSetReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*BMCSettingsSetReconciler) Reconcile added in v0.2.0

+kubebuilder:rbac:groups=metal.ironcore.dev,resources=bmcsettingssets,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=metal.ironcore.dev,resources=bmcsettingssets/status,verbs=get;update;patch +kubebuilder:rbac:groups=metal.ironcore.dev,resources=bmcsettingssets/finalizers,verbs=update +kubebuilder:rbac:groups=metal.ironcore.dev,resources=bmcsettings,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=metal.ironcore.dev,resources=bmcs,verbs=get;list;watch +kubebuilder:rbac:groups=metal.ironcore.dev,resources=servers,verbs=get;list;watch +kubebuilder:rbac:groups=metal.ironcore.dev,resources=servermaintenances,verbs=get;list;watch

func (*BMCSettingsSetReconciler) SetupWithManager added in v0.2.0

func (r *BMCSettingsSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCVersionReconciler

type BMCVersionReconciler struct {
	client.Client
	ManagerNamespace string
	Insecure         bool
	Scheme           *runtime.Scheme
	BMCOptions       bmc.Options
	ResyncInterval   time.Duration
	Conditions       *conditionutils.Accessor
}

BMCVersionReconciler reconciles a BMCVersion object

func (*BMCVersionReconciler) Reconcile

func (r *BMCVersionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BMCVersionReconciler) SetupWithManager

func (r *BMCVersionReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BMCVersionSetReconciler

type BMCVersionSetReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BMCVersionSetReconciler reconciles a BMCVersionSet object

func (*BMCVersionSetReconciler) Reconcile

func (r *BMCVersionSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*BMCVersionSetReconciler) SetupWithManager

func (r *BMCVersionSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DNSRecordTemplateData added in v0.2.0

type DNSRecordTemplateData struct {
	Name      string
	Namespace string
	metalv1alpha1.BMCSpec
	metalv1alpha1.BMCStatus
	Labels map[string]string
}

DNSRecordTemplateData contains the data used to render the DNS record YAML template

type EndpointReconciler

type EndpointReconciler struct {
	client.Client
	Scheme      *runtime.Scheme
	MACPrefixes *macdb.MacPrefixes
	Insecure    bool
	BMCOptions  bmc.Options
}

EndpointReconciler reconciles a Endpoints object

func (*EndpointReconciler) Reconcile

func (r *EndpointReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*EndpointReconciler) SetupWithManager

func (r *EndpointReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ServerBootConfigurationReconciler

type ServerBootConfigurationReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ServerBootConfigurationReconciler reconciles a ServerBootConfiguration object

func (*ServerBootConfigurationReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ServerBootConfigurationReconciler) SetupWithManager

func (r *ServerBootConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ServerClaimReconciler

type ServerClaimReconciler struct {
	client.Client
	Cache                   cache.Cache
	Scheme                  *runtime.Scheme
	MaxConcurrentReconciles int
}

ServerClaimReconciler reconciles a ServerClaim object

func (*ServerClaimReconciler) Reconcile

func (r *ServerClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ServerClaimReconciler) SetupWithManager

func (r *ServerClaimReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ServerMaintenanceReconciler

type ServerMaintenanceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ServerMaintenanceReconciler reconciles a ServerMaintenance object

func (*ServerMaintenanceReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ServerMaintenanceReconciler) SetupWithManager

func (r *ServerMaintenanceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ServerReconciler

type ServerReconciler struct {
	client.Client
	Scheme                  *runtime.Scheme
	Insecure                bool
	ManagerNamespace        string
	ProbeImage              string
	RegistryURL             string
	ProbeOSImage            string
	RegistryResyncInterval  time.Duration
	EnforceFirstBoot        bool
	EnforcePowerOff         bool
	ResyncInterval          time.Duration
	BMCOptions              bmc.Options
	DiscoveryTimeout        time.Duration
	MaxConcurrentReconciles int
	Conditions              *conditionutils.Accessor
}

ServerReconciler reconciles a Server object

func (*ServerReconciler) Reconcile

func (r *ServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ServerReconciler) SetupWithManager

func (r *ServerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL