controller

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConditionPoweringOn indicates a server is powering on.
	ConditionPoweringOn = "PoweringOn"
	// ConditionReset indicates a reset condition.
	ConditionReset = "Reset"
	// ConditionReady indicates readiness.
	ConditionReady = "Ready"
	// ConditionWaitingForPowerOff is set while the server is waiting for the BMC
	// to confirm it is powered off before the claim can be released.
	ConditionWaitingForPowerOff = "WaitingForPowerOff"
)

Shared condition types used across multiple controllers.

View Source
const (
	// ReasonAuthenticationFailed indicates authentication has failed.
	ReasonAuthenticationFailed = "AuthenticationFailed"
	// ReasonInternalError indicates an internal server error.
	ReasonInternalError = "InternalServerError"
	// ReasonUnknownError indicates an unknown error.
	ReasonUnknownError = "UnknownError"
	// ReasonConnectionFailed indicates a connection failure.
	ReasonConnectionFailed = "ConnectionFailed"
	// ReasonUserReset indicates a user-requested reset.
	ReasonUserReset = "UserRequested"
	// ReasonAutoReset indicates an automatic reset.
	ReasonAutoReset = "AutoResetting"
	// ReasonConnected indicates a successful connection.
	ReasonConnected = "Connected"
	// ReasonWaitingForPowerOff is used while waiting for the BMC to confirm the host is powered off.
	ReasonWaitingForPowerOff = "WaitingForPowerOff"
	// ReasonPowerOffConfirmed marks WaitingForPowerOff as resolved.
	ReasonPowerOffConfirmed = "PowerOffConfirmed"
	// ReasonResetComplete indicates a BMC reset has completed successfully.
	ReasonResetComplete = "ResetComplete"
)

Shared reason strings used across multiple controllers.

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"
)

Variables

This section is empty.

Functions

func GenerateRandomPassword

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

GenerateRandomPassword generates a random password of the given length.

func RegisterIndexFields added in v0.2.0

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

Types

type BMCReconciler

type BMCReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	DefaultProtocol    metalv1alpha1.ProtocolScheme
	SkipCertValidation 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
	// SSHResetTimeout defines the timeout for SSH reset operations (dial + command execution).
	SSHResetTimeout time.Duration
}

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.24.1/pkg/reconcile

func (*BMCSecretReconciler) SetupWithManager

func (r *BMCSecretReconciler) 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
	DefaultProtocol    metalv1alpha1.ProtocolScheme
	SkipCertValidation 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)

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 (*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
	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 ServerClaimSchedulerReconciler added in v0.8.0

type ServerClaimSchedulerReconciler struct {
	client.Client
	APIReader               client.Reader
	MaxConcurrentReconciles int
}

ServerClaimSchedulerReconciler schedules unbound ServerClaims onto matching Servers and drives the claim phase from Unbound to Bound once the binding is complete.

func (*ServerClaimSchedulerReconciler) Reconcile added in v0.8.0

Reconcile moves a ServerClaim from unbound to bound by selecting a matching, claimable Server, claiming it and recording the server reference on the claim.

func (*ServerClaimSchedulerReconciler) SetupWithManager added in v0.8.0

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

SetupWithManager sets up the controller with the Manager.

type ServerReadinessRuleReconciler added in v0.6.0

type ServerReadinessRuleReconciler struct {
	client.Client
}

ServerReadinessRuleReconciler reconciles a ServerReadinessRule object

func (*ServerReadinessRuleReconciler) Reconcile added in v0.6.0

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 (*ServerReadinessRuleReconciler) SetupWithManager added in v0.6.0

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

SetupWithManager sets up the controller with the Manager.

type ServerReadinessRuleServerReconciler added in v0.6.0

type ServerReadinessRuleServerReconciler struct {
	client.Client
}

func (*ServerReadinessRuleServerReconciler) Reconcile added in v0.6.0

func (*ServerReadinessRuleServerReconciler) SetupWithManager added in v0.6.0

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

type ServerReconciler

type ServerReconciler struct {
	client.Client
	APIReader               client.Reader
	Scheme                  *runtime.Scheme
	Recorder                events.EventRecorder
	DefaultProtocol         metalv1alpha1.ProtocolScheme
	SkipCertValidation      bool
	ManagerNamespace        string
	ProbeImage              string
	ProbeOSImage            string
	RegistryURL             string
	RegistryClientTimeout   time.Duration
	RegistryDataMaxAge      time.Duration
	RegistryResyncInterval  time.Duration
	EnforceFirstBoot        bool
	EnforcePowerOff         bool
	ResyncInterval          time.Duration
	BMCOptions              bmc.Options
	DiscoveryTimeout        time.Duration
	MaxConcurrentReconciles int
	Conditions              *conditionutils.Accessor
	DiscoveryIgnitionPath   string
}

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