LATEST VERSION: v1.1 - RELEASE NOTES
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 https://raw.githubusercontent.com/cloudfoundry-incubator/kubo-ci/master/specs/storage-class-gcp.yml
    • vSphere:
      $ wget https://raw.githubusercontent.com/cloudfoundry-incubator/kubo-ci/master/specs/storage-class-vsphere.yml
  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 https://raw.githubusercontent.com/cloudfoundry-incubator/kubo-ci/master/specs/persistent-volume-claim.yml
    

  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 pks-feedback@pivotal.io.

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