Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 15. Preflight validation for Kernel Module Management (KMM) Modules
Before performing an upgrade on the cluster with applied KMM modules, the administrator must verify that kernel modules installed using KMM are able to be installed on the nodes after the cluster upgrade and possible kernel upgrade. Preflight attempts to validate every
Module
Module
Module
15.1. Validation kickoff Link kopierenLink in die Zwischenablage kopiert!
Preflight validation is triggered by creating a
PreflightValidationOCP
type PreflightValidationOCPSpec struct {
// releaseImage describes the OCP release image that all Modules need to be checked against.
// +kubebuilder:validation:Required
ReleaseImage string `json:"releaseImage"`
// Boolean flag that determines whether images build during preflight must also
// be pushed to a defined repository
// +optional
PushBuiltImage bool `json:"pushBuiltImage"`
}
15.2. Validation lifecycle Link kopierenLink in die Zwischenablage kopiert!
Preflight validation attempts to validate every module loaded in the cluster. Preflight will stop running validation on a
Module
If you want to run Preflight validation for an additional kernel, then you should create another
PreflightValidationOCP
PreflightValidationOCP
15.3. Validation status Link kopierenLink in die Zwischenablage kopiert!
Preflight reports the status and progress of each module in the cluster that it attempts to validate.
type CRStatus struct {
// Status of Module CR verification: true (verified), false (verification failed),
// error (error during verification process), unknown (verification has not started yet)
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=True;False
VerificationStatus string `json:"verificationStatus"`
// StatusReason contains a string describing the status source.
// +optional
StatusReason string `json:"statusReason,omitempty"`
// Current stage of the verification process:
// image (image existence verification), build(build process verification)
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=Image;Build;Sign;Requeued;Done
VerificationStage string `json:"verificationStage"`
// LastTransitionTime is the last time the CR status transitioned from one status to another.
// This should be when the underlying status changed. If that is not known, then using the time when the API field changed is acceptable.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
LastTransitionTime metav1.Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"`
}
The following fields apply to each module:
15.4. Preflight validation stages per Module Link kopierenLink in die Zwischenablage kopiert!
Preflight runs the following validations on every KMM Module present in the cluster:
- Image validation stage
- Build validation stage
- Sign validation stage
15.4.1. Image validation stage Link kopierenLink in die Zwischenablage kopiert!
Image validation is always the first stage of the preflight validation to be executed. If image validation is successful, no other validations are run on that specific module.
Image validation consists of two stages:
- Image existence and accessibility. The code tries to access the image defined for the upgraded kernel in the module and get its manifests.
-
Verify the presence of the kernel module defined in the in the correct path for future
Moduleexecution. The correct path ismodprobe.<dirname>/lib/modules/<upgraded_kernel>/
If this validation is successful, it probably means that the kernel module was compiled with the correct Linux headers.
15.4.2. Build validation stage Link kopierenLink in die Zwischenablage kopiert!
Build validation is executed only when image validation has failed and there is a
build
Module
You must specify the kernel version when running
depmod
$ RUN depmod -b /opt ${KERNEL_VERSION}
If the
PushBuiltImage
PreflightValidationOCP
containerImage
Module
If the
sign
containerImage
Module
15.4.3. Sign validation stage Link kopierenLink in die Zwischenablage kopiert!
Sign validation is executed only when image validation has failed, there is a
sign
Module
build
Module
If the
PushBuiltImage
PreflightValidationOCP
The resulting image is always the image defined in the
containerImage
Module
UnsignedImage
If a
build
sign
build
sign
PushBuiltImage
PreflightValidationOCP
15.5. Example PreflightValidationOCP resource Link kopierenLink in die Zwischenablage kopiert!
This section shows an example of the
PreflightValidationOCP
The example verifies all the currently present modules against the upcoming kernel version included in the OpenShift Container Platform release 4.11.18, which the following release image points to:
quay.io/openshift-release-dev/ocp-release@sha256:22e149142517dfccb47be828f012659b1ccf71d26620e6f62468c264a7ce7863
Because
.spec.pushBuiltImage
true
apiVersion: kmm.sigs.x-k8s.io/v1beta1
kind: PreflightValidationOCP
metadata:
name: preflight
spec:
releaseImage: quay.io/openshift-release-dev/ocp-release@sha256:22e149142517dfccb47be828f012659b1ccf71d26620e6f62468c264a7ce7863
pushBuiltImage: true