Generating a seed image for the image-based upgrade with the {lcao}
Use the Lifecycle Agent to generate the seed image with the SeedGenerator custom resource (CR).
Seed image configuration
The seed image targets a set of single-node OpenShift clusters with the same hardware and similar configuration. This means that the seed image must have all of the components and configuration that the seed cluster shares with the target clusters. Therefore, the seed image generated from the seed cluster cannot contain any cluster-specific configuration.
The following table lists the components, resources, and configurations that you must and must not include in your seed image:
| Cluster configuration | Include in seed image |
|---|---|
Performance profile |
Yes |
|
Yes |
IP version configuration, either IPv4, IPv6, or dual-stack networking |
Yes |
Set of Day 2 Operators, including the Lifecycle Agent and the OADP Operator |
Yes |
Disconnected registry configuration [2] |
Yes |
Valid proxy configuration [3] |
Yes |
FIPS configuration |
Yes |
Dedicated partition on the primary disk for container storage that matches the size of the target clusters |
Yes |
Local volumes
|
No |
OADP |
No |
-
If the seed cluster is installed in a disconnected environment, the target clusters must also be installed in a disconnected environment.
-
The proxy configuration must be either enabled or disabled in both the seed and target clusters. However, the proxy servers configured on the clusters does not have to match.
Seed image configuration using the RAN DU profile
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:
| Resource | Include in seed image |
|---|---|
All extra manifests that are applied as part of Day 0 installation |
Yes |
All Day 2 Operator subscriptions |
Yes |
|
Yes |
|
Yes |
|
Yes |
|
Yes |
|
Yes |
|
No, if it is used in |
|
No |
|
No |
| Resource | Apply as extra manifest |
|---|---|
|
Yes Note The DU profile includes the Cluster Logging Operator, but the profile does not configure or apply any Cluster Logging Operator CRs. To enable log forwarding, include the |
|
Yes |
|
Yes |
|
Yes |
|
Yes |
|
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. |
|
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. |
Generating a seed image with the Lifecycle Agent
Use the Lifecycle Agent to generate a seed image from a managed cluster. 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:
-
Stopping cluster Operators
-
Preparing the seed image configuration
-
Generating and pushing the seed image to the image repository specified in the
SeedGeneratorCR -
Restoring cluster Operators
-
Expiring seed cluster certificates
-
Generating new certificates for the seed cluster
-
Restoring and updating the
SeedGeneratorCR on the seed cluster
-
RHACM and multicluster engine for Kubernetes Operator are not installed on the seed cluster.
-
You have configured a shared container directory on the seed cluster.
-
You have installed the minimum version of the OADP Operator and the Lifecycle Agent on the seed cluster.
-
Ensure that persistent volumes are not configured on the seed cluster.
-
Ensure that the
LocalVolumeCR does not exist on the seed cluster if the Local Storage Operator is used. -
Ensure that the
LVMClusterCR does not exist on the seed cluster if LVM Storage is used. -
Ensure that the
DataProtectionApplicationCR does not exist on the seed cluster if OADP is used.
-
Detach the managed cluster from the hub to delete any RHACM-specific resources from the seed cluster that must not be in the seed image:
-
Manually detach the seed cluster by running the following command:
$ oc delete managedcluster sno-worker-example-
Wait until the managed cluster is removed. After the cluster is removed, create the proper
SeedGeneratorCR. The Lifecycle Agent cleans up the RHACM artifacts.
-
-
If you are using GitOps ZTP, detach your cluster by removing the seed cluster’s
ClusterInstanceCR from thekustomization.yaml.-
If you have a
kustomization.yamlfile that references multipleClusterInstanceCRs, remove your seed cluster’sClusterInstanceCR from thekustomization.yaml:apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: #- clusterinstance-seed-sno1.yaml - clusterinstance-target-sno2.yaml - clusterinstance-target-sno3.yaml -
If you have a
kustomization.yamlthat references oneClusterInstanceCR, remove your seed cluster’sClusterInstanceCR from thekustomization.yamland add theresources: []line:apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: [] -
Commit the
kustomization.yamlchanges in your Git repository and push the changes to your repository.The ArgoCD pipeline detects the changes and removes the managed cluster.
-
-
-
Create the
Secretobject so that you can push the seed image to your registry.-
Create the authentication file by running the following commands:
$ MY_USER=myuserid$ AUTHFILE=/tmp/my-auth.json$ podman login --authfile ${AUTHFILE} -u ${MY_USER} quay.io/${MY_USER}$ base64 -w 0 ${AUTHFILE} ; echo -
Copy the output into the
seedAuthfield in theSecretYAML file namedseedgenin theopenshift-lifecycle-agentnamespace:apiVersion: v1 kind: Secret metadata: name: seedgen namespace: openshift-lifecycle-agent type: Opaque data: seedAuth: <encoded_AUTHFILE>- The
Secretresource must have thename: seedgenandnamespace: openshift-lifecycle-agentfields. - Specifies a base64-encoded authfile for write-access to the registry for pushing the generated seed images.
- The
-
Apply the
Secretby running the following command:$ oc apply -f secretseedgenerator.yaml
-
-
Create the
SeedGeneratorCR:apiVersion: lca.openshift.io/v1 kind: SeedGenerator metadata: name: seedimage spec: seedImage: <seed_container_image>- The
SeedGeneratorCR must be namedseedimage. - 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.
- The
-
Generate the seed image by running the following command:
$ oc apply -f seedgenerator.yamlImportant
The cluster reboots and loses API capabilities while the Lifecycle Agent generates the seed image. Applying the
SeedGeneratorCR stops thekubeletand the CRI-O operations, then it starts the image generation.
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.
-
After the cluster recovers and it is available, you can check the status of the
SeedGeneratorCR by running the following command:$ oc get seedgenerator -o yaml
status:
conditions:
- lastTransitionTime: "2024-02-13T21:24:26Z"
message: Seed Generation completed
observedGeneration: 1
reason: Completed
status: "False"
type: SeedGenInProgress
- lastTransitionTime: "2024-02-13T21:24:26Z"
message: Seed Generation completed
observedGeneration: 1
reason: Completed
status: "True"
type: SeedGenCompleted
observedGeneration: 1
- The seed image generation is complete.