Use Ephemeral volumes
Generic Ephemeral volumes
Generic ephemeral volumes also work with typical storage operations such as snapshotting, cloning, resizing, and storage capacity tracking.
The following steps will allow you to create a generic ephemeral volume with the Portworx CSI Driver.
In this example we are using the
px-csi-db storage class out of the box. Please refer CSI Enabled Storage Classes for a list of available CSI enabled storage classes offered by Portworx.
Create a pod spec that uses a Portworx CSI Driver StorageClass, declaring the ephemeral volume as seen below in a YAML file named
kind: Pod apiVersion: v1 metadata: name: my-app spec: containers: - name: my-frontend image: busybox volumeMounts: - mountPath: "/scratch" name: scratch-volume command: [ "sleep", "1000000" ] volumes: - name: scratch-volume ephemeral: volumeClaimTemplate: metadata: labels: type: my-frontend-volume spec: accessModes: [ "ReadWriteOnce" ] storageClassName: "px-csi-db" resources: requests: storage: 1Gi
ephemeral-volume-pod.yamlspec to create the pod with a generic ephemeral volume:
kubectl apply -f ephemeral-volume-pod.yaml
Migration to CSI PVCs
Currently, you cannot migrate or convert PVCs created using the native Kubernetes driver to the CSI driver. However, this is not required, and both types of PVCs can co-exist on the same cluster.
Portworx, Inc. welcomes contributions to its CSI implementation, which is open-source with a repository located at OpenStorage. In addition, we also encourage contributions to the Kubernetes-CSI open source implementation.