Difference between revisions of "Kind: PersistentVolumeClaim"

From wikieduonline
Jump to navigation Jump to search
Line 7: Line 7:
  
 
Including PV name:
 
Including PV name:
apiVersion: "v1"
+
apiVersion: "v1"
kind: "PersistentVolumeClaim"
+
kind: "PersistentVolumeClaim"
metadata:
+
metadata:
  name: "claimapp80"
+
  name: "claimapp80"
spec:
+
spec:
  accessModes:
+
  accessModes:
    - "ReadWriteOnce"
+
    - "ReadWriteOnce"
  resources:
+
  resources:
    requests:
+
    requests:
      storage: "10Gi"
+
      storage: "10Gi"
  volumeName: "app080"
+
  volumeName: "app080"
  
 
[[Expansion]]:
 
[[Expansion]]:

Revision as of 11:50, 8 February 2024

Kubernetes Persistent Volume Claim (PVC)

Examples

 apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: your-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:

Including PV name:

apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
  name: "claimapp80"
spec:
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: "10Gi"
  volumeName: "app080"

Expansion:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: myclaim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi # specify new size here

Errors

error: error validating "yourfile": error validating data: 

[ ValidationError(PersistentVolumeClaim.metadata.finalizers): invalid type for 
io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.finalizers: got "string", expected "array", 

ValidationError(PersistentVolumeClaim): unknown field "name" in 
io.k8s.api.core.v1.PersistentVolumeClaim ]; if you choose to ignore these errors, turn 

validation off with --validate=false


0/3 nodes are available: 3 persistentvolumeclaim "yourstorage" bound to non-existent persistentvolume

Related

See also

Advertising: