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, 2019 in GCP by anonymous
• 6,260 points
3,226 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, 2019 by Sirajul
• 59,230 points
How to use this persistent volume claim with my GKE cluster?

Related Questions In GCP

+1 vote
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, 2019 in GCP by Sirajul
• 59,230 points
1,852 views
0 votes
1 answer
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, 2019 in GCP by Sirajul
• 59,230 points
7,026 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, 2019 in GCP by Sirajul
• 59,230 points
1,838 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, 2019 in GCP by Sirajul
• 59,230 points
4,002 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, 2019 in GCP by Sirajul
• 59,230 points
2,052 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP