Configuring the registry for OpenStack

    Procedure

    1. Create a YAML file that specifies the storage class and availability zone to use. For example:

    2. From a command line, apply the configuration:

      Example output

      1. storageclass.storage.k8s.io/custom-csi-storageclass created
      1. apiVersion: v1
      2. kind: PersistentVolumeClaim
      3. metadata:
      4. name: csi-pvc-imageregistry
      5. namespace: openshift-image-registry (1)
      6. annotations:
      7. spec:
      8. - ReadWriteOnce
      9. volumeMode: Filesystem
      10. resources:
      11. requests:
      12. storage: 100Gi (2)
      13. storageClassName: <your_custom_storage_class> (3)
      1Enter the namespace openshift-image-registry. This namespace allows the Cluster Image Registry Operator to consume the PVC.
      2Optional: Adjust the volume size.
      3Enter the name of the storage class that you created.
    3. From a command line, apply the configuration:

      Example output

      1. persistentvolumeclaim/csi-pvc-imageregistry created
    4. Replace the original persistent volume claim in the image registry configuration with the new claim:

      1. $ oc patch configs.imageregistry.operator.openshift.io/cluster --type 'json' -p='[{"op": "replace", "path": "/spec/storage/pvc/claim", "value": "csi-pvc-imageregistry"}]'

      Example output

        Over the next several minutes, the configuration is updated.

      To confirm that the registry is using the resources that you defined:

      1. Verify that the PVC claim value is identical to the name that you provided in your PVC definition:

        Example output

        1. status:
        2. ...
        3. managementState: Managed
        4. pvc:
        5. claim: csi-pvc-imageregistry
        6. ...
      2. Verify that the status of the PVC is Bound:

        1. $ oc get pvc -n openshift-image-registry csi-pvc-imageregistry

        Example output

        1. NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
        2. csi-pvc-imageregistry Bound pvc-72a8f9c9-f462-11e8-b6b6-fa163e18b7b5 100Gi RWO custom-csi-storageclass 11m