6.3. Transitioning the active-ocp-version ClusterImageSet
Optionally, the active-ocp-version ClusterImageSet is a GitOps Zero Touch Provisioning (ZTP) convention used in GitOps ZTP deployments. It provides a single, central definition of the OpenShift Container Platform release image to use when provisioning clusters. By default, this resource is synchronized to the hub cluster from the site-config/resources/ folder.
If your deployment uses an active-ocp-version ClusterImageSet CR, you must migrate it to the resources/ folder in the new directroy that contains ClusterInstance CRs. This prevents synchronization conflicts because both Argo CD applications cannot manage the same resource.
Prerequisites
-
You have completed the procedure to create the parallel Argo CD pipeline for
ClusterInstanceCRs. -
The Argo CD application points to the folder in your Git repository that will contain the new
ClusterInstanceCRs and associated cluster resouces. In this example, thesite-configs-v2/Argo CD application points to thesite-configs-v2/folder. -
Your Git repository contains an
active-ocp-version.yamlmanifest in theresources/folder.
Procedure
Copy the
resources/folder from thesite-configs/directory into the newsite-configs-v2/directory:$ cp -r site-configs/resources site-configs-v2/Remove the reference to the
resources/folder from thesite-configs/kustomization.yamlfile. This ensures that the oldclustersArgo CD application no longer manages theactive-ocp-versionresource.Example updated
site-configs/resources/kustomization.yamlfileapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - pre-reqs/ #- resources/ generators: - hub-1/sno1.yaml - hub-1/sno2.yaml - hub-1/sno3.yamlAdd the
resources/folder to thesite-configs-v2/kustomization.yamlfile. This step transfers ownership of theClusterImageSetto the newclusters-v2application.Example updated
site-configs-v2/kustomization.yamlfileapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - resources/- Commit and push the changes to the Git repository.
Verification
-
In Argo CD, verify that the
clusters-v2application is Healthy and Synced. If the
active-ocp-versionClusterImageSetresource in theclusterArgo application is out of sync, you can remove the Argo CD application label by running the following command:$ oc label clusterimageset active-ocp-version app.kubernetes.io/instance-Example output
clusterimageset.hive.openshift.io/active-ocp-version unlabeled