enable variable storageclass
This commit is contained in:
@@ -30,6 +30,8 @@ Boolean to specify if it is a hostpath
|
|||||||
[Example](https://gitea.tryton.geeraert.eu/pi-ux-ce/Terraform_kube#volume-as-hostpath)
|
[Example](https://gitea.tryton.geeraert.eu/pi-ux-ce/Terraform_kube#volume-as-hostpath)
|
||||||
#### pvc_size = optional(string)
|
#### pvc_size = optional(string)
|
||||||
#### mount_path = string
|
#### mount_path = string
|
||||||
|
#### storage_class_name = optional(string, "nfs-storage-intelligent")
|
||||||
|
This is the storage class, by default it will use nfs-storage-intelligent but it can be changed to something more suitable
|
||||||
### environment = optional(map(object({
|
### environment = optional(map(object({
|
||||||
### name = optional(string)
|
### name = optional(string)
|
||||||
### value = optional(string)
|
### value = optional(string)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ variable "kubernetes" {
|
|||||||
config_map = optional(bool, false)
|
config_map = optional(bool, false)
|
||||||
host_path = optional(string)
|
host_path = optional(string)
|
||||||
pvc_size = optional(string)
|
pvc_size = optional(string)
|
||||||
|
storage_class_name = optional(string, "nfs-storage-intelligent")
|
||||||
mount_path = string
|
mount_path = string
|
||||||
})))
|
})))
|
||||||
environment = optional(map(object({
|
environment = optional(map(object({
|
||||||
@@ -63,6 +64,7 @@ locals {
|
|||||||
name = pvc.name
|
name = pvc.name
|
||||||
pvc_size = pvc.pvc_size
|
pvc_size = pvc.pvc_size
|
||||||
mount_path = pvc.mount_path
|
mount_path = pvc.mount_path
|
||||||
|
storage_class_name = pvc.storage_class_name
|
||||||
namespace = coalesce(value.namespace, key)
|
namespace = coalesce(value.namespace, key)
|
||||||
}] if value.enabled == true && value.pvc != null
|
}] if value.enabled == true && value.pvc != null
|
||||||
])
|
])
|
||||||
@@ -131,7 +133,7 @@ resource "kubernetes_persistent_volume_claim" "automatic-pvc" {
|
|||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
access_modes = ["ReadWriteMany"]
|
access_modes = ["ReadWriteMany"]
|
||||||
storage_class_name = "nfs-storage-intelligent"
|
storage_class_name = each.value.storage_class_name
|
||||||
resources {
|
resources {
|
||||||
requests = {
|
requests = {
|
||||||
storage = each.value.pvc_size
|
storage = each.value.pvc_size
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ kubernetes = {
|
|||||||
|
|
||||||
|
|
||||||
stash = {
|
stash = {
|
||||||
enabled = false
|
# enabled = false
|
||||||
name = "stash"
|
name = "stash"
|
||||||
image = "stashapp/stash:latest"
|
image = "stashapp/stash:latest"
|
||||||
service_port = 9999
|
service_port = 9999
|
||||||
@@ -156,8 +156,8 @@ kubernetes = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
requirements = {
|
requirements = {
|
||||||
limits-cpu = "100m"
|
limits-cpu = "1000m"
|
||||||
limits-memory = "300Mi"
|
limits-memory = "3000Mi"
|
||||||
requests-cpu = "50m"
|
requests-cpu = "50m"
|
||||||
requests-memory = "150Mi"
|
requests-memory = "150Mi"
|
||||||
}
|
}
|
||||||
@@ -167,6 +167,7 @@ kubernetes = {
|
|||||||
pvc_size = "100Mi"
|
pvc_size = "100Mi"
|
||||||
pvc = true
|
pvc = true
|
||||||
mount_path = "/data"
|
mount_path = "/data"
|
||||||
|
storage_class_name = "nfs-storage-fastaccess"
|
||||||
}
|
}
|
||||||
metadata = {
|
metadata = {
|
||||||
name = "metadata"
|
name = "metadata"
|
||||||
@@ -468,7 +469,7 @@ kubernetes = {
|
|||||||
|
|
||||||
|
|
||||||
next = {
|
next = {
|
||||||
# enabled = false
|
enabled = false
|
||||||
namespace = "next"
|
namespace = "next"
|
||||||
replicas = 01
|
replicas = 01
|
||||||
image = "nextcloud:29.0.3-apache"
|
image = "nextcloud:29.0.3-apache"
|
||||||
|
|||||||
Reference in New Issue
Block a user