Migrating your Data Foundation ImageContentSourcePolicy to ImageDigestMirrorSet

Migrate the Fusion Data Foundation ImageContentSourcePolicy to an ImageDigestMirrorSet.

About this task

Using an ImageContentSourcePolicy (ICSP) object to configure repository mirroring is a deprecated feature. Though this function is still included in Red Hat® OpenShift® Container Platform, do not use it for new deployments.

On Red Hat OpenShift Container Platform version 4.14.4, the ImageContentSourcePolicy can coexist with the ImageDigestMirrorSet. You can migrate the Fusion Data Foundation ImageContentSourcePolicy to an ImageDigestMirrorSet.

Procedure

  1. Log in to the Red Hat OpenShift Container Platform as a user with sufficient permissions to complete the task.
    oc login --token=<API token> --server=https://<server name>:6443
  2. Run the following command to get the name of the image content source policies on your cluster.
    oc get ImageContentSourcePolicy
  3. Set the FDF_ICSP environment variable to the name of the Fusion Data Foundation ImageContentSourcePolicy.
    The default name of the Fusion Data Foundation ImageContentSourcePolicy is isf-fdf-icsp. The following command uses the default name:
    export FDF_ICSP=isf-fdf-icsp
  4. Save the ImageContentSourcePolicy as a YAML file on the cluster.
    The following command saves the YAML file to the current directory:
    oc get ImageContentSourcePolicy ${FDF_ICSP} -o yaml >> ${FDF_ICSP}.yaml
  5. Convert the ImageContentSourcePolicy to an ImageDigestMirrorSet:
    oc create -f $(oc adm migrate icsp ${FDF_ICSP}.yaml | cut -f 4 -d ' ')
    Note: This command might trigger node upgrades. Wait for all the nodes to be in Ready state before you proceed to the next step.
  6. Delete the ImageContentSourcePolicy:
    oc delete ImageContentSourcePolicy ${FDF_ICSP}
    Note: This command might trigger node upgrades. Wait for all the nodes to be in Ready state before you proceed to the next step.
  7. If ImageTagMirrorSet for Data Foundation does not exist, then add it.
    
    apiVersion: config.openshift.io/v1
    kind: ImageTagMirrorSet
    metadata:
    name: isf-fdf
    spec:
    imageTagMirrors:
        - mirrors:
        - <enterprise registry host:port>/<target-path>/df/isf-data-foundation-catalog
        source: icr.io/cpopen/isf-data-foundation-catalog 
    mirrorSourcePolicy: 
        AllowContactingSource 0
  8. Optional: Remove the image digest value in fusionservicedefinition/data-foundation-service.
    Before you remove the image digest, confirm that the current digest value is the same as the current tag name. Use skopeo to get the digest ID of your current tag.
    1. Query the imageDigest from your enterprise registry. Replace v4.14 with your current Red Hat OpenShift Container Platform version.
      skopeo inspect docker://<enterprise registry host:port>/<target-path>/cpopen/isf-data-foundation-catalog:v4.14 | jq -r ".Digest"
    2. Run the following OC command.
      oc edit fusionservicedefinition data-foundation-service -n ibm-spectrum-fusion-ns
      Warning: The imageDigest value from 8.a must be consistent with fsd data-foundation-service CR spec:
      `.spec.onboarding.multiVersionCatSrcDetails.ocp414-t`
      if the two digestIDs are different, IBM Storage Fusion triggers a Data Foundation upgrade. Make sure the tag-based catalog image (<enterprise registry host:port>/<target-path>/cpopen/isf-data-foundation-catalog:v4.14) is always the latest.
    3. If you confirm the same digest ID or accept the upgrade, you can delete the line as follows and save it.
      Example:
      
      spec:
      hasRelatedDefinition: false
      onboarding:
      ...
          serviceOperatorSubscription:
          catalogSourceName: isf-data-foundation-catalog
          createCatalogSource: true
          globalCatalogSource: true
          isClusterWide: false
          multiVersionCatSrcDetails:
              ocp49:
              skipCatSrcCreation: true
              ocp410:
              skipCatSrcCreation: true
              ocp411:
              skipCatSrcCreation: true
              ocp414-t:
              displayName: Data Foundation Catalog
              imageDigest: sha256:2d9e78d69a457b722cf6037968dae5f48eccd9e48ef4369a7fe661de0d96df95   <<-- delete this line
              imageName: isf-data-foundation-catalog
              imageTag: v4.14
              publisher: IBM
              registryPath: icr.io/cpopen
              skipCatSrcCreation: false
    4. Verify whether the catalog source image is updated.
      Example:
      # oc get catalogsources.operators.coreos.com -n openshift-marketplace isf-data-foundation-catalog -o jsonpath={'.spec.image'}
      icr.io/cpopen/isf-data-foundation-catalog:v4.14