homelab-nomad/storage_plugins/democratic-csi.tf

49 lines
1.0 KiB
Terraform
Raw Permalink Normal View History

2022-06-17 22:19:19 +00:00
variable "image_name" {
type = string
default = "docker.io/democraticcsi/democratic-csi:latest"
}
variable "csi_version" {
type = string
default = "1.5.0"
}
locals {
democratic_nfs_config = file("${path.module}/democratic-nfs-config.yml")
}
# resource "nomad_job" "nfs-monolith" {
# hcl2 {
# vars = {
# "image_name" = "${var.image_name}",
# "csi_version" = "${var.csi_version}",
# }
# }
#
# jobspec = file("${path.module}/democratic-nfs.nomad")
# }
resource "nomad_job" "storage-controller" {
hcl2 {
vars = {
2022-11-02 19:32:27 +00:00
"image_name" = var.image_name,
"csi_version" = var.csi_version,
"config_data" = local.democratic_nfs_config
2022-06-17 22:19:19 +00:00
}
}
jobspec = file("${path.module}/democratic-csi-nfs-controller.nomad")
}
resource "nomad_job" "storage-node" {
hcl2 {
vars = {
2022-11-02 19:32:27 +00:00
"image_name" = var.image_name,
"csi_version" = var.csi_version,
"config_data" = local.democratic_nfs_config
2022-06-17 22:19:19 +00:00
}
}
jobspec = file("${path.module}/democratic-csi-nfs-node.nomad")
}