Skip to content

Commit 7595cac

Browse files
committed
Add multi-architecture IPA support and configurable probes.
Signed-off-by: s3rj1k <[email protected]>
1 parent 5c1324a commit 7595cac

File tree

8 files changed

+1539
-19
lines changed

8 files changed

+1539
-19
lines changed

api/v1alpha1/ironic_types.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,32 @@ type Networking struct {
169169
RPCPort int32 `json:"rpcPort,omitempty"`
170170
}
171171

172+
// CPUArchitecture represents a CPU architecture supported by IPA.
173+
// +kubebuilder:validation:Enum=x86_64;aarch64
174+
type CPUArchitecture string
175+
176+
const (
177+
// ArchX86_64 represents the x86_64 (amd64) architecture.
178+
ArchX86_64 CPUArchitecture = "x86_64"
179+
// ArchAarch64 represents the aarch64 (arm64) architecture.
180+
ArchAarch64 CPUArchitecture = "aarch64"
181+
)
182+
183+
// AgentImages defines a single IPA (Ironic Python Agent) image configuration.
184+
type AgentImages struct {
185+
// Kernel is the URL of the IPA kernel image.
186+
// Example: "file:///shared/html/images/ironic-python-agent.kernel"
187+
Kernel string `json:"kernel"`
188+
189+
// Initramfs is the URL of the IPA initramfs/ramdisk image.
190+
// Example: "file:///shared/html/images/ironic-python-agent.initramfs"
191+
Initramfs string `json:"initramfs"`
192+
193+
// Architecture is the target CPU architecture for this image.
194+
// Each image must have a unique architecture.
195+
Architecture CPUArchitecture `json:"architecture"`
196+
}
197+
172198
// DeployRamdisk defines IPA ramdisk settings.
173199
type DeployRamdisk struct {
174200
// DisableDownloader tells the operator not to start the IPA downloader as the init container.
@@ -250,7 +276,6 @@ type Images struct {
250276
// Warning: modifying arbitrary options may cause your Ironic installation to
251277
// fail or misbehave. Do not modify anything you don't understand well.
252278
type ExtraConfig struct {
253-
254279
// The group that config belongs to.
255280
// +optional
256281
Group string `json:"group,omitempty"`
@@ -292,11 +317,28 @@ type Overrides struct {
292317
// +optional
293318
Containers []corev1.Container `json:"containers,omitempty"`
294319

320+
// HttpdLivenessProbe configures the httpd container liveness probe.
321+
// If not set and AgentImages is not specified, defaults to checking /images/ironic-python-agent.kernel exists.
322+
// When AgentImages is specified, no default probe is configured.
323+
// +optional
324+
HttpdLivenessProbe *corev1.Probe `json:"httpdLivenessProbe,omitempty"`
325+
326+
// HttpdReadinessProbe configures the httpd container readiness probe.
327+
// If not set and AgentImages is not specified, defaults to checking /images/ironic-python-agent.kernel exists.
328+
// When AgentImages is specified, no default probe is configured.
329+
// +optional
330+
HttpdReadinessProbe *corev1.Probe `json:"httpdReadinessProbe,omitempty"`
331+
295332
// InitContainers to append to the main Ironic pod.
296333
// If a container name matches an existing init container, the existing init container is replaced.
297334
// +optional
298335
InitContainers []corev1.Container `json:"initContainers,omitempty"`
299336

337+
// AgentImages overrides the default IPA (Ironic Python Agent) images provided by the downloader.
338+
// Each image must have a unique architecture (rendered as DEPLOY_KERNEL_BY_ARCH/DEPLOY_RAMDISK_BY_ARCH).
339+
// +optional
340+
AgentImages []AgentImages `json:"agentImages,omitempty"`
341+
300342
// Extra labels to add to each pod (including upgrade jobs).
301343
// +optional
302344
Labels map[string]string `json:"labels,omitempty"`

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)