Skip to content

Commit 0ddf03d

Browse files
feat: longhorn (#64)
1 parent ea2cdf2 commit 0ddf03d

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,16 @@ module "mariadb" {
201201
rg_name = azurerm_resource_group.rg.name
202202
}
203203

204+
module "longhorn" {
205+
depends_on = [
206+
module.aks,
207+
module.argo-cd
208+
]
209+
source = "./modules/longhorn/"
210+
rg_location = azurerm_resource_group.rg.location
211+
rg_name = azurerm_resource_group.rg.name
212+
}
213+
204214
module "postgres" {
205215
depends_on = [
206216
module.aks,

modules/longhorn/longhorn.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
locals {
2+
namespace = "longhorn-system"
3+
}
4+
5+
resource "kubernetes_namespace" "longhorn" {
6+
metadata {
7+
name = local.namespace
8+
}
9+
}
10+
11+
resource "helm_release" "longhorn" {
12+
name = "longhorn"
13+
repository = "https://charts.longhorn.io"
14+
chart = "longhorn/longhorn"
15+
version = "1.8.1"
16+
17+
namespace = local.namespace
18+
}

modules/longhorn/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
variable "rg_location" {
2+
type = string
3+
nullable = false
4+
}
5+
6+
variable "rg_name" {
7+
type = string
8+
nullable = false
9+
}

0 commit comments

Comments
 (0)