mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
138 lines
3.5 KiB
Plaintext
138 lines
3.5 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * registry/configuring_registry_storage/configuring-registry-storage.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="installation-registry-osp-creating-custom-pvc_{context}"]
|
|
= Configuring an image registry with custom storage on clusters that run on {rh-openstack}
|
|
|
|
[role="_abstract"]
|
|
After you install a cluster on {rh-openstack-first}, you can use a Cinder volume that is in a specific availability zone for registry storage.
|
|
|
|
.Procedure
|
|
|
|
. Create a YAML file that specifies the storage class and availability zone to use. For example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: custom-csi-storageclass
|
|
provisioner: cinder.csi.openstack.org
|
|
volumeBindingMode: WaitForFirstConsumer
|
|
allowVolumeExpansion: true
|
|
parameters:
|
|
availability: <availability_zone_name>
|
|
----
|
|
+
|
|
[NOTE]
|
|
====
|
|
{product-title} does not verify the existence of the availability zone you choose. Verify the name of the availability zone before you apply the configuration.
|
|
====
|
|
|
|
. From a command line, apply the configuration:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <storage_class_file_name>
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
storageclass.storage.k8s.io/custom-csi-storageclass created
|
|
----
|
|
|
|
. Create a YAML file that specifies a persistent volume claim (PVC) that uses your storage class and the `openshift-image-registry` namespace. For example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: csi-pvc-imageregistry
|
|
namespace: openshift-image-registry
|
|
annotations:
|
|
imageregistry.openshift.io: "true"
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
volumeMode: Filesystem
|
|
resources:
|
|
requests:
|
|
storage: 100Gi
|
|
storageClassName: <your_custom_storage_class>
|
|
----
|
|
+
|
|
where:
|
|
|
|
`openshift-image-registry`:: Specifying this namespace allows the Cluster Image Registry Operator to consume the PVC.
|
|
`storage`:: This optional field adjusts the volume size.
|
|
`storageClassName`:: Specifies the name of the storage class that you created.
|
|
|
|
. From a command line, apply the configuration:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <pvc_file_name>
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
persistentvolumeclaim/csi-pvc-imageregistry created
|
|
----
|
|
|
|
. Replace the original persistent volume claim in the image registry configuration with the new claim:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc patch configs.imageregistry.operator.openshift.io/cluster --type 'json' -p='[{"op": "replace", "path": "/spec/storage/pvc/claim", "value": "csi-pvc-imageregistry"}]'
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
config.imageregistry.operator.openshift.io/cluster patched
|
|
----
|
|
+
|
|
Over the next several minutes, the configuration is updated.
|
|
|
|
.Verification
|
|
|
|
To confirm that the registry is using the resources that you defined:
|
|
|
|
. Verify that the PVC claim value is identical to the name that you provided in your PVC definition:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get configs.imageregistry.operator.openshift.io/cluster -o yaml
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
...
|
|
status:
|
|
...
|
|
managementState: Managed
|
|
pvc:
|
|
claim: csi-pvc-imageregistry
|
|
...
|
|
----
|
|
|
|
. Verify that the status of the PVC is `Bound`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get pvc -n openshift-image-registry csi-pvc-imageregistry
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
|
|
csi-pvc-imageregistry Bound pvc-72a8f9c9-f462-11e8-b6b6-fa163e18b7b5 100Gi RWO custom-csi-storageclass 11m
|
|
----
|