Skip to content

Commit 7ccb917

Browse files
authored
Merge pull request #77202 from StephenJamesSmith/TELCODOCS-1848
TELCODOCS-1848: Add PreflightValidation v1beta2
2 parents 978bc59 + fd6b83f commit 7ccb917

8 files changed

+37
-71
lines changed

modules/kmm-build-validation-stage.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ Build validation is executed only when image validation has failed and there is
1111
[NOTE]
1212
====
1313
You must specify the kernel version when running `depmod`, as shown here:
14+
1415
[source,terminal]
1516
----
1617
$ RUN depmod -b /opt ${KERNEL_VERSION}
1718
----
1819
====
1920

20-
If the `PushBuiltImage` flag is defined in the `PreflightValidationOCP` custom resource (CR), it will also try to push the resulting image into its repository. The resulting image name is taken from the definition of the `containerImage` field of the `Module` CR.
21+
22+
If the `PushBuiltImage` flag is defined in the `PreflightValidationOCP` custom resource (CR), it also tries to push the resulting image into its repository. The resulting image name is taken from the definition of the `containerImage` field of the `Module` CR.
2123

2224
[NOTE]
2325
====

modules/kmm-example-cr.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88

99
This section shows an example of the `PreflightValidationOCP` resource in the YAML format.
1010

11-
The example verifies all the currently present modules against the upcoming kernel version included in the {product-title} release 4.11.18, which the following release image points to:
11+
The example verifies all of the currently present modules against the upcoming kernel version included in the {product-title} release 4.11.18, which the following release image points to:
1212

1313
[source,terminal]
1414
----
1515
quay.io/openshift-release-dev/ocp-release@sha256:22e149142517dfccb47be828f012659b1ccf71d26620e6f62468c264a7ce7863
1616
----
1717

18-
Because `.spec.pushBuiltImage` is set to `true`, KMM pushes the resulting images of Build/Sign into the defined repositories.
18+
Because `.spec.pushBuiltImage` is set to `true`, KMM pushes the resulting images of Build/Sign in to the defined repositories.
1919

2020
[source,yaml]
2121
----
22-
apiVersion: kmm.sigs.x-k8s.io/v1beta1
22+
apiVersion: kmm.sigs.x-k8s.io/v1beta2
2323
kind: PreflightValidationOCP
2424
metadata:
25-
name: preflight
25+
name: preflight
2626
spec:
27-
releaseImage: quay.io/openshift-release-dev/ocp-release@sha256:22e149142517dfccb47be828f012659b1ccf71d26620e6f62468c264a7ce7863
28-
pushBuiltImage: true
27+
releaseImage: quay.io/openshift-release-dev/ocp-release@sha256:22e149142517dfccb47be828f012659b1ccf71d26620e6f62468c264a7ce7863
28+
pushBuiltImage: true
2929
----

modules/kmm-image-validation-stage.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ Image validation consists of two stages:
1212

1313
. Image existence and accessibility. The code tries to access the image defined for the upgraded kernel in the module and get its manifests.
1414

15-
. Verify the presence of the kernel module defined in the `Module` in the correct path for future `modprobe` execution. The correct path is `<dirname>/lib/modules/<upgraded_kernel>/`.
16-
17-
If this validation is successful, it probably means that the kernel module was compiled with the correct Linux headers.
15+
. Verify the presence of the kernel module defined in the `Module` in the correct path for future `modprobe` execution. If this validation is successful, it probably means that the kernel module was compiled with the correct Linux headers. The correct path is `<dirname>/lib/modules/<upgraded_kernel>/`.

modules/kmm-sign-validation-stage.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
[id="kmm-sign-validation-stage_{context}"]
77
= Sign validation stage
88

9-
Sign validation is executed only when image validation has failed, there is a `sign` section in the `Module` that is relevant for the upgrade kernel, and build validation finished successfully in the event there was a `build` section in the `Module` relevant for the upgraded kernel. Sign validation will try to run the sign job and validate that it finishes successfully.
9+
Sign validation is executed only when image validation has failed. There is a `sign` section in the `Module` resource that is relevant for the upgrade kernel, and build validation finishes successfully in case there was a `build` section in the `Module` relevant for the upgraded kernel. Sign validation attempts to run the sign job and validate that it finishes successfully.
1010

11-
If the `PushBuiltImage` flag is defined in the `PreflightValidationOCP` CR, sign validation will also try to push the resulting image to its registry.
12-
13-
The resulting image is always the image defined in the `containerImage` field of the `Module`. The input image is either the output of the Build stage, or an image defined in the `UnsignedImage` field.
11+
If the `PushBuiltImage` flag is defined in the `PreflightValidationOCP` CR, sign validation also tries to push the resulting image to its registry. The resulting image is always the image defined in the `ContainerImage` field of the `Module`. The input image is either the output of the Build stage, or an image defined in the `UnsignedImage` field.
1412

1513
[NOTE]
1614
====

modules/kmm-validation-kickoff.adoc

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@
88

99
Preflight validation is triggered by creating a `PreflightValidationOCP` resource in the cluster. This spec contains two fields:
1010

11-
[source,terminal]
12-
----
13-
type PreflightValidationOCPSpec struct {
14-
// releaseImage describes the OCP release image that all Modules need to be checked against.
15-
// +kubebuilder:validation:Required
16-
ReleaseImage string `json:"releaseImage"` <1>
17-
// Boolean flag that determines whether images build during preflight must also
18-
// be pushed to a defined repository
19-
// +optional
20-
PushBuiltImage bool `json:"pushBuiltImage"` <2>
21-
}
22-
----
11+
`releaseImage`:: Mandatory field that provides the name of the release image for the {product-title} version the cluster is upgraded to.
2312

24-
<1> `ReleaseImage` - Mandatory field that provides the name of the release image for the {product-title} version the cluster is upgraded to.
25-
26-
<2> `PushBuiltImage` - If `true`, then the images created during the Build and Sign validation are pushed to their repositories (`false` by default).
13+
`pushBuiltImage`:: If `true`, then the images created during the Build and Sign validation are pushed to their repositories. This field is `false` by default.

modules/kmm-validation-lifecycle.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
[id="kmm-validation-lifecycle_{context}"]
77
= Validation lifecycle
88

9-
Preflight validation attempts to validate every module loaded in the cluster. Preflight will stop running validation on a `Module` resource after the validation is successful. In case module validation has failed, you can change the module definitions and Preflight will try to validate the module again in the next loop.
9+
Preflight validation attempts to validate every module loaded in the cluster. Preflight stops running validation on a `Module` resource after the validation is successful. If module validation fails, you can change the module definitions and Preflight tries to validate the module again in the next loop.
1010

1111
If you want to run Preflight validation for an additional kernel, then you should create another `PreflightValidationOCP` resource for that kernel. After all the modules have been validated, it is recommended to delete the `PreflightValidationOCP` resource.

modules/kmm-validation-status.adoc

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,23 @@
66
[id="kmm-validation-status_{context}"]
77
= Validation status
88

9-
Preflight reports the status and progress of each module in the cluster that it attempts to
10-
validate.
11-
12-
[source,terminal]
13-
----
14-
type CRStatus struct {
15-
// Status of Module CR verification: true (verified), false (verification failed),
16-
// error (error during verification process), unknown (verification has not started yet)
17-
// +required
18-
// +kubebuilder:validation:Required
19-
// +kubebuilder:validation:Enum=True;False
20-
VerificationStatus string `json:"verificationStatus"` <1>
21-
// StatusReason contains a string describing the status source.
22-
// +optional
23-
StatusReason string `json:"statusReason,omitempty"` <2>
24-
// Current stage of the verification process:
25-
// image (image existence verification), build(build process verification)
26-
// +required
27-
// +kubebuilder:validation:Required
28-
// +kubebuilder:validation:Enum=Image;Build;Sign;Requeued;Done
29-
VerificationStage string `json:"verificationStage"` <3>
30-
// LastTransitionTime is the last time the CR status transitioned from one status to another.
31-
// This should be when the underlying status changed. If that is not known, then using the time when the API field changed is acceptable.
32-
// +required
33-
// +kubebuilder:validation:Required
34-
// +kubebuilder:validation:Type=string
35-
// +kubebuilder:validation:Format=date-time
36-
LastTransitionTime metav1.Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"` <4>
37-
}
38-
----
39-
40-
The following fields apply to each module:
41-
42-
<1> `VerificationStatus` - `true` or `false`, validated or not.
43-
44-
<2> `StatusReason` - Verbal explanation regarding the status.
45-
46-
<3> `VerificationStage` - Describes the validation stage being executed (Image, Build, Sign).
47-
48-
<4> `LastTransitionTime` - The time of the last update to the status.
9+
A `PreflightValidationOCP` resource reports the status and progress of each module in the cluster that it attempts or has attempted to validate in its `.status.modules` list. Elements of that list contain the following fields:
10+
11+
`lastTransitionTime`:: The last time the `Module` resource status transitioned from one status to another. This should be when the underlying status has changed. If that is not known, then using the time when the API field changed is acceptable.
12+
13+
`name`:: The name of the `Module` resource.
14+
15+
`namespace`:: The namespace of the `Module` resource.
16+
17+
`statusReason`:: Verbal explanation regarding the status.
18+
19+
`verificationStage`:: Describes the validation stage being executed: +
20+
* `image`: Image existence verification
21+
* `build`: Build process verification
22+
* `sign`: Sign process verification
23+
24+
`verificationStatus`:: The status of the Module verification: +
25+
* `true`: Verified
26+
* `false`: Verification failed
27+
* `error`: Error during the verification process
28+
* `unknown`: Verfication has not started

updating/preparing_for_updates/kmm-preflight-validation.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ WARNING: This assembly has been moved into a subdirectory for 4.14+. Changes to
1111

1212
To do: Remove this comment once 4.13 docs are EOL.
1313
////
14+
// Updated for TELCODOCS-1848
1415

15-
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` loaded in the cluster, in parallel. Preflight does not wait for validation of one `Module` to complete before starting validation of another `Module`.
16+
Before performing an upgrade on the cluster with applied KMM modules, you 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` loaded in the cluster, in parallel. Preflight does not wait for validation of one `Module` to complete before starting validation of another `Module`.
1617

1718
:FeatureName: Kernel Module Management Operator Preflight validation
1819

0 commit comments

Comments
 (0)