This commit is contained in:
Hrankin, Aleksandr (contracted)
2026-02-19 11:34:13 +00:00
commit f243f440c3
191 changed files with 6183 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
resource "helm_release" "openebs" {
name = var.release_name
repository = "https://openebs.github.io/openebs"
chart = "openebs"
version = var.chart_version
namespace = var.namespace
create_namespace = true
}

View File

@@ -0,0 +1,25 @@
resource "kubernetes_storage_class_v1" "openebs_hostpath" {
metadata {
name = var.storageclass_name
annotations = {
"storageclass.kubernetes.io/is-default-class" = "true"
"openebs.io/cas-type" = "local"
}
}
storage_provisioner = "openebs.io/local"
reclaim_policy = "Delete"
volume_binding_mode = "WaitForFirstConsumer"
allow_volume_expansion = false
parameters = {
"cas.openebs.io/config" = <<-EOT
- name: StorageType
value: "hostpath"
- name: BasePath
value: "${var.base_path}"
EOT
}
depends_on = [helm_release.openebs]
}

View File

@@ -0,0 +1,26 @@
variable "namespace" {
type = string
default = "openebs"
}
variable "release_name" {
type = string
default = "openebs"
}
variable "chart_version" {
type = string
default = null
description = "Версия helm chart openebs (null = последняя доступная)."
}
variable "storageclass_name" {
type = string
default = "openebs-local-hostpath"
}
variable "base_path" {
type = string
default = "/var/openebs/local/"
description = "Путь на нодах для hostpath LocalPV (можно кастомизировать)."
}

View File

@@ -0,0 +1,6 @@
terraform {
required_providers {
helm = { source = "hashicorp/helm" }
kubernetes = { source = "hashicorp/kubernetes" }
}
}