instruction: Create a Dockerfile for storage
output: ```dockerfile
  from multiple storage options.
  More information on storage classes can be found
  here.
  Enabling Dynamic Provisioning
  To enable dynamic provisioning, a cluster administrator needs to pre-create
  one or more StorageClass objects for users.
  StorageClass objects define which provisioner should be used and what parameters
  should be passed to that provisioner when dynamic provisioning is invoked.
  The name of a StorageClass object must be a valid
  DNS subdomain name.
  The following manifest creates a storage class "slow" which provisions standard
  disk-like persistent disks.
  apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
   name: slow
  provisioner: kubernetes.io/gce-pd
  parameters:
   type: pd-standard
  The following manifest creates a storage class "fast" which provisions
  SSD-like persistent disks.
  apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
   name: fast
  provisioner: kubernetes.io/gce-pd
  parameters:
   type: pd-ssd
  Using Dynamic Provisioning
  Users request dynamically provisioned storage by including a storage class in
  their PersistentVolumeClaim. Before Kubernetes v1.6, this was done via the
  volume.beta.kubernetes.io/storage-class annotation. However, this annotation
  is deprecated since v1.9. Users now can and should instead use the
  storageClassName field of the PersistentVolumeClaim object. The value of
  this field must match the name of a StorageClass configured by the
  administrator (see below).
  To select the "fast" storage class, for example, a user would create the
  following PersistentVolumeClaim:
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
   name: claim1
  spec:
   accessModes:
   - ReadWriteOnce
   storageClassName: fast
   resources:
   requests:
   storage: 30Gi
  This claim results in an SSD-like Persistent Disk being automatically
  provisioned. When the claim is deleted, the volume is destroyed.
  Defaulting Behavior
  Dynamic provisioning can be enabled on a cluster such that all claims are
  dynamically provisioned if no storage class is specified. A cluster administrator
  can enable this behavior by:
  
  Marking one StorageClass object as default;
  Making sure that the DefaultStorageClass admission controller
  is enabled on the API server.
  
  An administrator can mark a specific StorageClass as default by adding the
  storageclass.kubernetes.io/is-default-class annotation to it.
  When a default StorageClass exists in a cluster and a user creates a
  PersistentVolumeClaim with storageClassName unspecified, the
  DefaultStorageClass admission controller automatically adds the
  storageClassName field pointing to the default storage class.
  Note that if you set the storageclass.kubernetes.io/is-default-class
  annotation to true on more than one StorageClass in your cluster, and you then
  create a PersistentVolumeClaim with no storageClassName set, Kubernetes
  uses the most recently created default StorageClass.
  Topology Awareness
  In Multi-Zone clusters, Pods can be spread across
  Zones in a Region. Single-Zone storage backends should be provisioned in the Zones where
  Pods are scheduled. This can be accomplished by setting the
  Volume Binding Mode.
  
  Feedback
  Was this page helpful?
  Yes
  No
  
   Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on
  
   Stack Overflow.
   Open an issue in the GitHub Repository if you want to
  
   report a problem
   or
  
   suggest an improvement.
  
   Last modified February 14, 2024 at 9:39 AM PST: Update content/en/docs/concepts/storage/dynamic-provisioning.md (5aca46b3d0)
  
    Create child page
   Create an issue
   Print entire section
  
  Background
  Enabling Dynamic Provisioning
  Using Dynamic Provisioning
  Defaulting Behavior
  Topology Awareness
  
  Documentation
  Blog
  Training
  Partners
  Community
  Case Studies
  
  © 2025 The Kubernetes Authors | Documentation Distributed under CC BY 4.0
  
  ICP license: 京ICP备17074266号-3
  ```