Kubernetes ||pvc question ||

Create a new PersistentVolumeClaim

  • Name: pv-volume
  • Class: csi-hostpath-sc
  • Capacity: 10Mi
    Create a new Pod which mounts the PersistentVolumeClaim as a volume:
  • Name: web-server
  • Image: nginx
  • Mount path: /usr/share/nginx/html
    Configure the new Pod to have ReadWriteOnce
    Finally, using kubectl edit or kubectl patch PersistentVolumeClaim to a capacity of 70Mi and
    record that change.

for this question find my answer below ,kindly suggest for
PersistentVolumeClaim to a capacity of 70Mi and
record that change. when i type below command
#kubectl rollout history pvc pv-volume
error: error retrieving history for “PersistentVolumeClaim”, no visitor method exists for { PersistentVolumeClaim}

is it expected ?
vi pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
storageClassName: csi-hostpath-sc

kubectl apply -f pvc.yaml

vi web-server.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: web-server
name: web-server
spec:
containers:

  • image: nginx
    name: web-server
    volumeMounts:

    • mountPath: “/usr/share/nginx/html”
      name: myvolume
      volumes:

    • name: myvolume
      persistentVolumeClaim:
      claimName: pv-volume

      kubectl apply -f web-server.yaml

    kubectl edit pvc pv-volume --record //change storage 10Mi to 70Mi

    root@controlplane ~ :heavy_multiplication_x: kubectl rollout history pvc pv-volume
    error: error retrieving history for “PersistentVolumeClaim”, no visitor method exists for { PersistentVolumeClaim}

kubectl rollout history is not supported for PVC and hence you are seeing those errors.
One way to confirm if the volume change is working is by restarting the pod. Once the pods are restarted it takes effect. You can check the pvc again for the update.

Thanks for sharing @ mukeshvb