Skip to content

Commit d011ac8

Browse files
committed
TELCODOCS-1707: Add Preparing/Generate seed image
1 parent 3825387 commit d011ac8

10 files changed

+340
-26
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,8 +3088,8 @@ Topics:
30883088
File: cnf-image-based-upgrade-shared-container-image
30893089
- Name: Installing Operators for the image-based upgrade
30903090
File: cnf-image-based-upgrade-install-operators
3091-
# - Name: Generating a seed image for the image-based upgrade with Lifecycle Agent
3092-
# File: cnf-image-based-upgrade-generate-seed
3091+
- Name: Generating a seed image for the image-based upgrade with Lifecycle Agent
3092+
File: cnf-image-based-upgrade-generate-seed
30933093
# - Name: Creating ConfigMap objects for the image-based upgrade with Lifecycle Agent
30943094
# File: cnf-image-based-upgrade-prep-resources
30953095
# - Name: Creating ConfigMap objects for the image-based upgrade with Lifecycle Agent using GitOps ZTP
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="cnf-image-based-upgrade-seed-image"]
3+
= Generating a seed image for the image-based upgrade with {lcao}
4+
include::_attributes/common-attributes.adoc[]
5+
:context: generate-seed
6+
7+
toc::[]
8+
9+
Use the {lcao} to generate the seed image with the `SeedGenerator` custom resource (CR).
10+
11+
:FeatureName: The Lifecycle Agent
12+
13+
14+
include::modules/cnf-image-based-upgrade-seed-image-config.adoc[leveloffset=+1]
15+
16+
include::modules/cnf-image-based-upgrade-generate-seed-image.adoc[leveloffset=+1]
17+
18+
////
19+
[role="_additional-resources"]
20+
.Additional resources
21+
22+
* xref:../../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image##cnf-image-based-upgrade-shared-container-directory_shared-container-directory[Configuring a shared container directory between ostree stateroots]
23+
24+
* xref:../../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image#ztp-image-based-upgrade-shared-container-directory_shared-container-directory[Configuring a shared container directory between ostree stateroots when using GitOps ZTP]
25+
////

edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-install-operators.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ include::modules/cnf-image-based-upgrade-installing-lifecycle-agent-using-web-co
2929

3030
include::modules/ztp-image-based-upgrade-installing-lcao-with-gitops.adoc[leveloffset=+1]
3131

32-
include::modules/ztp-image-based-upgrade-installing-oadp-with-gitops.adoc[leveloffset=+1]
32+
include::modules/ztp-image-based-upgrade-installing-oadp-with-gitops.adoc[leveloffset=+1]

edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ You can do this at install time.
1313

1414
include::modules/cnf-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
1515

16-
include::modules/ztp-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
16+
include::modules/ztp-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="ztp-image-based-upgrade-seed-generation_{context}"]
6+
= Generating a seed image with the {lcao}
7+
8+
Use the {lcao} to generate the seed image with the `SeedGenerator` CR. The Operator checks for required system configurations, performs any necessary system cleanup before generating the seed image, and launches the image generation. The seed image generation includes the following tasks:
9+
10+
* Stopping cluster Operators
11+
* Preparing the seed image configuration
12+
* Generating and pushing the seed image to the image repository specified in the `SeedGenerator` CR
13+
* Restoring cluster Operators
14+
* Expiring seed cluster certificates
15+
* Generating new certificates for the seed cluster
16+
* Restoring and updating the `SeedGenerator` CR on the seed cluster
17+
18+
.Prerequisites
19+
20+
* Configure a shared container directory on the seed cluster.
21+
* Install the OADP Operator and the {lcao} on the seed cluster.
22+
23+
.Procedure
24+
25+
. Detach the cluster from the hub to delete any cluster-specific resources from the seed cluster that must not be in the seed image:
26+
27+
.. If you are using {rh-rhacm}, manually detach the seed cluster by running the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc delete managedcluster sno-worker-example
32+
----
33+
34+
... Wait until the `ManagedCluster` CR is removed. After the CR is removed, create the proper `SeedGenerator` CR. The {lcao} cleans up the {rh-rhacm} artifacts.
35+
36+
.. If you are using {ztp}, detach your cluster by removing the seed cluster's `SiteConfig` CR from the `kustomization.yaml`:
37+
38+
... Remove your seed cluster's `SiteConfig` CR from the `kustomization.yaml`.
39+
+
40+
[source,yaml]
41+
----
42+
apiVersion: kustomize.config.k8s.io/v1beta1
43+
kind: Kustomization
44+
45+
generators:
46+
#- example-seed-sno1.yaml
47+
- example-target-sno2.yaml
48+
- example-target-sno3.yaml
49+
----
50+
51+
... Commit the `kustomization.yaml` changes in your Git repository and push the changes.
52+
+
53+
The ArgoCD pipeline detects the changes and removes the managed cluster.
54+
55+
. Create the `Secret`:
56+
57+
.. Create the authentication file by running the following commands:
58+
+
59+
--
60+
[source,terminal]
61+
----
62+
$ MY_USER=myuserid
63+
$ AUTHFILE=/tmp/my-auth.json
64+
$ podman login --authfile ${AUTHFILE} -u ${MY_USER} quay.io/${MY_USER}
65+
----
66+
67+
[source,terminal]
68+
----
69+
$ base64 -w 0 ${AUTHFILE} ; echo
70+
----
71+
--
72+
73+
.. Copy the output into the `seedAuth` field in the `Secret` YAML file named `seedgen` in the `openshift-lifecycle-agent` namespace:
74+
+
75+
--
76+
[source,yaml]
77+
----
78+
apiVersion: v1
79+
kind: Secret
80+
metadata:
81+
name: seedgen <1>
82+
namespace: openshift-lifecycle-agent
83+
type: Opaque
84+
data:
85+
seedAuth: <encoded_AUTHFILE> <2>
86+
----
87+
<1> The `Secret` resource must have the `name: seedgen` and `namespace: openshift-lifecycle-agent` fields.
88+
<2> Specifies a base64-encoded authfile for write-access to the registry for pushing the generated seed images.
89+
--
90+
91+
.. Apply the `Secret` by running the following command:
92+
+
93+
[source,terminal]
94+
----
95+
$ oc apply -f secretseedgenerator.yaml
96+
----
97+
98+
. Create the `SeedGenerator` CR:
99+
+
100+
--
101+
[source,yaml]
102+
----
103+
apiVersion: lca.openshift.io/v1
104+
kind: SeedGenerator
105+
metadata:
106+
name: seedimage <1>
107+
spec:
108+
seedImage: <seed_container_image> <2>
109+
----
110+
<1> The `SeedGenerator` CR must be named `seedimage`.
111+
<2> Specify the container image URL, for example, `quay.io/example/seed-container-image:<tag>`. It is recommended to use the `<seed_cluster_name>:<ocp_version>` format.
112+
--
113+
114+
. Generate the seed image by running the following command:
115+
+
116+
[source,terminal]
117+
----
118+
$ oc apply -f seedgenerator.yaml
119+
----
120+
121+
+
122+
[IMPORTANT]
123+
====
124+
The cluster reboots and loses API capabilities while the {lcao} generates the seed image.
125+
Applying the `SeedGenerator` CR stops the `kubelet` and the CRI-O operations, then it starts the image generation.
126+
====
127+
128+
If you want to generate more seed images, you must provision a new seed cluster with the version that you want to generate a seed image from.
129+
130+
.Verification
131+
132+
. After the cluster recovers and it is available, you can check the status of the `SeedGenerator` CR by running the following command:
133+
+
134+
--
135+
[source,terminal]
136+
----
137+
$ oc get seedgenerator -o yaml
138+
----
139+
140+
.Example output
141+
[source,yaml]
142+
----
143+
status:
144+
conditions:
145+
- lastTransitionTime: "2024-02-13T21:24:26Z"
146+
message: Seed Generation completed
147+
observedGeneration: 1
148+
reason: Completed
149+
status: "False"
150+
type: SeedGenInProgress
151+
- lastTransitionTime: "2024-02-13T21:24:26Z"
152+
message: Seed Generation completed
153+
observedGeneration: 1
154+
reason: Completed
155+
status: "True"
156+
type: SeedGenCompleted <1>
157+
observedGeneration: 1
158+
----
159+
<1> The seed image generation is complete.
160+
--

modules/cnf-image-based-upgrade-installing-lifecycle-agent-using-cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $ oc create -f lcao-subscription.yaml
7979

8080
.Verification
8181

82-
. To verify that the installation succeeded, inspect the CSV resource by running the following command::
82+
. To verify that the installation succeeded, inspect the CSV resource by running the following command:
8383
+
8484
[source,terminal]
8585
----

modules/cnf-image-based-upgrade-installing-lifecycle-agent-using-web-console.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can use the {product-title} web console to install the {lcao}.
1313
1414
.Procedure
1515

16-
. In the {product-title} web console, navigate to *Operators* *OperatorHub*.
16+
. In the {product-title} web console, navigate to *Operators* -> *OperatorHub*.
1717
. Search for the *{lcao}* from the list of available Operators, and then click *Install*.
1818
. On the *Install Operator* page, under *A specific namespace on the cluster* select *openshift-lifecycle-agent*.
1919
. Click *Install*.
@@ -22,7 +22,7 @@ You can use the {product-title} web console to install the {lcao}.
2222

2323
. To confirm that the installation is successful:
2424

25-
.. Click *Operators* *Installed Operators*.
25+
.. Click *Operators* -> *Installed Operators*.
2626
.. Ensure that the {lcao} is listed in the *openshift-lifecycle-agent* project with a *Status* of *InstallSucceeded*.
2727
+
2828
[NOTE]
@@ -32,5 +32,5 @@ During installation an Operator might display a *Failed* status. If the installa
3232

3333
If the Operator is not installed successfully:
3434

35-
. Click the *Operators* *Installed Operators*, and inspect the *Operator Subscriptions* and *Install Plans* tabs for any failure or errors under *Status*.
36-
. Click the *Workloads* *Pods*, and check the logs for pods in the *openshift-lifecycle-agent* project.
35+
. Click *Operators* -> *Installed Operators*, and inspect the *Operator Subscriptions* and *Install Plans* tabs for any failure or errors under *Status*.
36+
. Click *Workloads* -> *Pods*, and check the logs for pods in the *openshift-lifecycle-agent* project.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="ztp-image-based-seed-image-config_{context}"]
6+
= Seed image configuration
7+
8+
The seed image targets a set of {sno} clusters with similar configuration.
9+
This means that the seed image must have all of the components and configuration that the seed cluster shares with the target clusters.
10+
Therefore, the seed image generated from the seed cluster cannot contain any cluster-specific configuration.
11+
12+
The following table lists the components, resources, and configurations that you must and must not include in your seed image:
13+
14+
.Seed image configuration
15+
[cols=2*, width="80%", options="header"]
16+
|====
17+
|Cluster configuration
18+
|Include in seed image
19+
20+
|Performance profile
21+
|Yes
22+
23+
|`MachineConfig` resources for the target cluster
24+
|Yes
25+
26+
|IP version ^[1]^
27+
|Yes
28+
29+
|Set of Day 2 Operators, including the {lcao} and the OADP Operator
30+
|Yes
31+
32+
|Disconnected registry configuration
33+
|Yes
34+
35+
|Valid proxy configuration ^[2]^
36+
|Yes
37+
38+
|FIPS configuration
39+
|Yes
40+
41+
|Dedicated partition on the primary disk for container storage that matches the size of the target clusters
42+
|Yes
43+
44+
a|Local volumes
45+
46+
* `StorageClass` used in `LocalVolume` for LSO
47+
* `LocalVolume` for LSO
48+
* `LVMCluster` CR for LVMS
49+
|No
50+
51+
|OADP `DataProtectionApplication` CR
52+
|No
53+
|====
54+
. Dual-stack networking is not supported in this release.
55+
. The proxy configuration does not have to be the same.
56+
57+
[id="ztp-image-based-upgrade-seed-image-config-ran_{context}"]
58+
== Seed image configuration using the RAN DU profile
59+
60+
The following table lists the components, resources, and configurations that you must and must not include in the seed image when using the RAN DU profile:
61+
62+
.Seed image configuration with RAN DU profile
63+
[cols=2*, width="80%", options="header"]
64+
|====
65+
|Resource
66+
|Include in seed image
67+
68+
|All extra manifests that are applied as part of Day 0 installation
69+
|Yes
70+
71+
|All Day 2 Operator subscriptions
72+
|Yes
73+
74+
|`ClusterLogging.yaml`
75+
|Yes
76+
77+
|`DisableOLMPprof.yaml`
78+
|Yes
79+
80+
|`TunedPerformancePatch.yaml`
81+
|Yes
82+
83+
|`PerformanceProfile.yaml`
84+
|Yes
85+
86+
|`SriovOperatorConfig.yaml`
87+
|Yes
88+
89+
|`DisableSnoNetworkDiag.yaml`
90+
|Yes
91+
92+
|`StorageClass.yaml`
93+
|No, if it is used in `StorageLV.yaml`
94+
95+
|`StorageLV.yaml`
96+
|No
97+
98+
|`StorageLVMCluster.yaml`
99+
|No
100+
|====
101+
102+
.Seed image configuration with RAN DU profile for extra manifests
103+
[cols=2*, width="80%", options="header"]
104+
|====
105+
|Resource
106+
|Apply as extra manifest
107+
108+
|`ClusterLogForwarder.yaml`
109+
|Yes
110+
111+
|`ReduceMonitoringFootprint.yaml`
112+
|Yes
113+
114+
|`SriovFecClusterConfig.yaml`
115+
|Yes
116+
117+
|`PtpOperatorConfigForEvent.yaml`
118+
|Yes
119+
120+
|`DefaultCatsrc.yaml`
121+
|Yes
122+
123+
|`PtpConfig.yaml`
124+
|If the interfaces of the target cluster are common with the seed cluster, you can include them in the seed image. Otherwise, apply it as extra manifests.
125+
126+
a|`SriovNetwork.yaml`
127+
`SriovNetworkNodePolicy.yaml`
128+
|If the configuration, including namespaces, is exactly the same on both the seed and target cluster, you can include them in the seed image. Otherwise, apply them as extra manifests.
129+
|====

0 commit comments

Comments
 (0)