If you already have a persistent disk (say named pd-name), the manifest file below describes a corresponding PersistentVolume and PersistentVolumeClaim that you cluster can use.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-demo
spec:
storageClassName: ""
capacity:
storage: 500G
accessModes:
- ReadWriteOnce
gcePersistentDisk:
pdName: pd-name
fsType: ext4
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv-claim-demo
spec:
# It's necessary to specify "" as the storageClassName
# so that the default storage class won't be used, see
# https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
storageClassName: ""
volumeName: pv-demo
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500G
Use kubectl apply -f existing-pd.yaml to create the PersistentVolume and PersistentVolumeClaim.