Lab 4.3 - Setup Image Registry Persistent Storage

1. Create file pvc-registry.yaml

cat > deploy/pvc-registry.yaml << EOF
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: image-registry-nfs
  namespace: openshift-image-registry
spec:
  storageClassName: managed-nfs-storage
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 30Gi
EOF

2. Create pvc for image registry

oc create -f deploy/pvc-registry.yaml

3. Patch registry

oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'

4. Attach the storage

oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"pvc":{"claim":"image-registry-nfs"}}}}'

5. Verify registry pods

oc get pod -n openshift-image-registry
oc get configs.imageregistry.operator.openshift.io -o yaml

6. Check clusteroperator status. Wait until Availability become True.

oc get clusteroperator image-registry

7. Confirm that all the cluster components are online

oc get clusteroperators

8. Switch project to default

oc project default

Daftar Materi