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-volumekubectl apply -f web-server.yaml
kubectl edit pvc pv-volume --record //change storage 10Mi to 70Mi
root@controlplane ~ kubectl rollout history pvc pv-volume
error: error retrieving history for “PersistentVolumeClaim”, no visitor method exists for { PersistentVolumeClaim} -