Kubernetes - Storage Classes đĻ
Description đ
With Storage Classes
you can define a provisioner that can automatically provision storage and attach that to pods
.
Basic Commands
đ
Examples đ§Š
-
storage class
definitionsapiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: google-storage provisioner: kubernetes.io/gce-pd
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: aws-ebs provisioner: kubernetes.io/aws-ebs
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: delayed-volume-sc provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer
provisioner
is the name of thestorage provisioner
that will be used to provision thepersistent volume
parameters
are the parameters that will be passed to thestorage provisioner
-
for
pvc
to use thestorage class
, specify thestorage class
name in pvcspec.storageClassName
fieldapiVersion: v1 kind: PersistentVolumeClaim metadata: name: myclaim spec: storageClassName: google-storage accessModes: - ReadWriteOnce resources: requests: storage: 500Mi