How can I use a pre-existing disk as a persistent volume for a GKE cluster?

0 votes
How can I use a pre-existing disk as a persistent volume for a GKE cluster?
Nov 12 in GCP by anonymous
• 4,330 points
29 views

1 answer to this question.

0 votes

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.

answered Nov 12 by Sirajul
• 40,980 points
How to use this persistent volume claim with my GKE cluster?

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

How do I determine cluster endpoints for a GKE cluster?

To determine your cluster endpoints, describe your ...READ MORE

answered Oct 30 in GCP by Sirajul
• 40,980 points
20 views
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20 in GCP by Sirajul
• 40,980 points
172 views
0 votes
1 answer

How do I create a VPCN (Virtual private cloud network) on Google Cloud?

You can connect various GCP resources to each ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
40 views
0 votes
1 answer

Cloud SQL of google cloud is IaaS or PaaS?

Cloud SQL is PAAS (Plaform As A ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
63 views
0 votes
1 answer

What all services does Google Cloud provide as a part of machine learning?

Here's a list of  Machine learning services that ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
46 views