Created
December 8, 2019 23:37
-
-
Save rivernews/65732ac141edb26389c5c786cddf3e9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the following config is based on digitalocean doc | |
# https://www.digitalocean.com/docs/kubernetes/how-to/add-volumes/ | |
# | |
# other cloud provider may have different convention, i.e., needing to create a `kubernetes_persistent_volume` before creating a claim | |
# | |
# | |
# tf doc: https://www.terraform.io/docs/providers/kubernetes/r/persistent_volume_claim.html | |
resource "kubernetes_persistent_volume_claim" "app_digitalocean_pvc" { | |
metadata { | |
# for digitalocean - name must be lowercase alphanumeric values and dashes (hyphen) only | |
name = "my-postgres-persistent-volume-claim" | |
namespace = "my-postgres-namespace" | |
} | |
spec { | |
access_modes = ["ReadWriteOnce"] | |
resources { | |
requests = { | |
storage = "1Gi" # digitalocean: changing the storage value in the resource definition after the volume has been created will have no effect | |
} | |
} | |
storage_class_name = "do-block-storage" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment