Pivotal Container Service v1.1

Using Dynamic Persistent Volumes

When using PKS, you can choose to pre-provision persistent storage or create on-demand persistent storage volumes. Refer to the Kubernetes documentation for more information about storage management.

Perform the steps in this section to define a PersistentVolumeClaim that you can apply to newly-created pods.

  1. Download the StorageClass spec for your cloud provider.

    • GCP:
      $ wget
    • vSphere:
      $ wget
  2. Apply the spec by running kubectl create -f STORAGE-CLASS-SPEC.yml. Replace STORAGE-CLASS-SPEC with the name of the file you downloaded in the previous step. For example:

    $ kubectl create -f storage-class-gcp.yml

  3. Run the following command to download the example PersistentVolumeClaim:

    $ wget

  4. Run the following command to apply the PersistentVolumeClaim:

    $ kubectl create -f persistent-volume-claim.yml

    • To confirm you applied the PersistentVolumeClaim, run the following command:
      $ kubectl get pvc -o wide
  5. To use the dynamic persistent volume, create a pod that uses the PersistentVolumeClaim. See the pv-guestbook.yml configuration file as an example.

Please send any feedback you have to

Create a pull request or raise an issue on the source for this page in GitHub