Hello:
I configured my Terraform v0.12.21 to deploy +100 webs with wordpress in Google Cloud Kubernetes Engine (GKE). I used Terraform to create one Persistent Volume Claim for each webpage.
Now I have a problem: I need to configure a snapshot schedule for all of that Persistent Volumes, but after reading a lot of the Google and Terraform documentation about the snapshot scheduler, I cannot find any example of how to do that:
Docs:
Here is an example of my code:
#VOLUME CLAIM
resource "kubernetes_persistent_volume_claim" "wordpress_volumeclaim" {
for_each = var.wordpress_site
metadata {
name = "wordpress-volumeclaim-${terraform.workspace}-${each.value.name}"
namespace = "default"
}
spec {
access_modes = ["ReadWriteOnce"]
resources {
requests = { storage = each.value.disk }
}
}
}
resource "kubernetes_deployment" "wordpress" {
for_each = var.wordpress_site
metadata {
name = each.value.name
labels = { app = each.value.name }
}
spec {
replicas = 1
selector {
match_labels = { app = each.value.name }
}
template {
metadata {
labels = { app = each.value.name }
}
spec {
volume {
name = "wordpress-persistent-storage-${terraform.workspace}-${each.value.name}"
persistent_volume_claim {
claim_name = "wordpress-volumeclaim-${terraform.workspace}-${each.value.name}"
}
}
Could you help me to add my snapshot scheduler (created manually in GCE, and named âsnapshot-pvcâ). Maybe this cannot be possibly done.
Thanks in advance,
aconde