Skip to content

Instantly share code, notes, and snippets.

@ralvares
Created June 1, 2020 13:44
Show Gist options
  • Save ralvares/d9c949b5701021ee6ae382e2730a9e03 to your computer and use it in GitHub Desktop.
Save ralvares/d9c949b5701021ee6ae382e2730a9e03 to your computer and use it in GitHub Desktop.
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
oc patch configs.imageregistry.operator.openshift.io/cluster --type merge --patch '{"spec":{"managementState": "Managed"}}'
cat > nfs.yaml << EOF
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-registry-storage
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 20Gi
nfs:
path: "/exports/pv-infra-registry"
server: "192.168.150.10"
persistentVolumeReclaimPolicy: Recycle
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: registry-storage
namespace: openshift-image-registry
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
EOF
oc apply -f nfs.yaml
oc patch configs.imageregistry.operator.openshift.io cluster --type='json' -p='[{"op": "remove", "path": "/spec/storage" },{"op": "add", "path": "/spec/storage", "value": {"pvc":{"claim": "registry-storage"}}}]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment