kubernetes-django icon indicating copy to clipboard operation
kubernetes-django copied to clipboard

Introduce Persistent Volume (Claim) for Postgresql data

Open hnarayanan opened this issue 8 years ago • 0 comments

From older notes:

  • (WIP!) Setup a persistent store for the database. In this example we're going to be using Persistent Disks from Google Cloud Platform. In order to make one of these, we create a disk and format it (using an instance that's temporarily created just for this purpose).
gcloud compute disks create pg-data-disk --size 50GB
gcloud compute instances create pg-disk-formatter
gcloud compute instances attach-disk pg-disk-formatter --disk pg-data-disk
gcloud compute config-ssh
ssh pg-disk-formatter.$GCP_PROJECT
    sudo mkfs.ext4 -F /dev/sdb
    exit
gcloud compute instances detach-disk pg-disk-formatter --disk pg-data-disk
gcloud compute instances delete pg-disk-formatter
- PostgreSQL Persistent Volume (Claims)
  kubectl create -f kubernetes/database/persistent-volume.yaml
  kubectl get pv
  kubectl create -f kubernetes/database/persistent-volume-claim.yaml
  kubectl get pvc

hnarayanan avatar Mar 20 '16 12:03 hnarayanan