enable variable storageclass

This commit is contained in:
2025-04-04 09:27:29 +01:00
parent 8a13ca3967
commit 6dc1f5427d
3 changed files with 26 additions and 21 deletions
+2
View File
@@ -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)
#### pvc_size = optional(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({
### name = optional(string)
### value = optional(string)
+3 -1
View File
@@ -17,6 +17,7 @@ variable "kubernetes" {
config_map = optional(bool, false)
host_path = optional(string)
pvc_size = optional(string)
storage_class_name = optional(string, "nfs-storage-intelligent")
mount_path = string
})))
environment = optional(map(object({
@@ -63,6 +64,7 @@ locals {
name = pvc.name
pvc_size = pvc.pvc_size
mount_path = pvc.mount_path
storage_class_name = pvc.storage_class_name
namespace = coalesce(value.namespace, key)
}] if value.enabled == true && value.pvc != null
])
@@ -131,7 +133,7 @@ resource "kubernetes_persistent_volume_claim" "automatic-pvc" {
}
spec {
access_modes = ["ReadWriteMany"]
storage_class_name = "nfs-storage-intelligent"
storage_class_name = each.value.storage_class_name
resources {
requests = {
storage = each.value.pvc_size
+5 -4
View File
@@ -133,7 +133,7 @@ kubernetes = {
stash = {
enabled = false
# enabled = false
name = "stash"
image = "stashapp/stash:latest"
service_port = 9999
@@ -156,8 +156,8 @@ kubernetes = {
}
}
requirements = {
limits-cpu = "100m"
limits-memory = "300Mi"
limits-cpu = "1000m"
limits-memory = "3000Mi"
requests-cpu = "50m"
requests-memory = "150Mi"
}
@@ -167,6 +167,7 @@ kubernetes = {
pvc_size = "100Mi"
pvc = true
mount_path = "/data"
storage_class_name = "nfs-storage-fastaccess"
}
metadata = {
name = "metadata"
@@ -468,7 +469,7 @@ kubernetes = {
next = {
# enabled = false
enabled = false
namespace = "next"
replicas = 01
image = "nextcloud:29.0.3-apache"