Expand a volume
As dynamic volume expansion is not activated, if one edits directly in the YAML object the size of the volume, an error like this will be returned:
(...)
# * spec: Forbidden: spec is immutable after creation except resources.requests for bound claims
(...)
When increasing the size of a PersistentVolumeClaim (PVC), it's recommended to use sizes that are multiples of 8 GiB (e.g., 16 GiB, 32 GiB, 64 GiB, 128 GiB, etc.).
Other values may not work and the size increase may silently fail.
Then a more artisanal procedure must be followed:
- Create a new volume with the desired size
 

- Scale down the deployment that mounts the volume that is being resized.
 

- Mount the old and new volume in another Pod. The best option is to create a new deployment, create a file called 
two-volumes.yamland replace the names of both volumes: 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: two-volumes
spec:
  replicas: 1
  selector:
    matchLabels:
      app: two-volumes
  template:
    metadata:
      labels:
        app: two-volumes
    spec:
      containers:
      - image: cscfi/nginx-okd:plus
        name: two-volumes
        ports:
        - containerPort: 8081
          protocol: TCP
        volumeMounts:
        - mountPath: /new
          name: new-volume
        - mountPath: /old
          name: old-volume
      volumes:
      - name: new-volume
        persistentVolumeClaim:
          claimName: new-volume
      - name: old-volume
        persistentVolumeClaim:
          claimName: old-volume
- Sync the data
 
- Delete that new Pod
 
- Exchange volumes in the deployment that was mounting the volume, it is at template > spec > volumes under 
claimName. 
- Finally scale up the deployment.
 
In order to check the procedure worked, you may enter in a Pod that is mounting the volume and check the new size.