Skip to content

Commit

Permalink
feat: add ff_infomaniak_sc
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeo committed Jul 10, 2024
1 parent 78f4e07 commit aec06ad
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
33 changes: 33 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,39 @@ module "servers" {
"patches/rke2-snapshot-validation-webhook.yaml" : templatefile("${path.module}/patches/rke2-snapshot-validation-webhook.yaml.tpl", {
}),
},
var.ff_infomaniak_sc ? merge([for perf in ["perf1", "perf2", "perf3"] : {
"sc-ceph-${perf}-delete.yaml" : templatefile("${path.module}/manifests/csi-cinder-sc.yaml.tpl", {
name = "ceph-${perf}-delete"
reclaimPolicy = "Delete"
is_default = false
parameters = {
type = "CEPH_1_${perf}"
}
})
}]...) : {},
var.ff_infomaniak_sc ? merge([for perf in ["perf1", "perf2", "perf3"] : {
"sc-ceph-${perf}-retain.yaml" : templatefile("${path.module}/manifests/csi-cinder-sc.yaml.tpl", {
name = "ceph-${perf}-retain"
reclaimPolicy = "Retain"
is_default = perf == "perf1"
parameters = {
type = "CEPH_1_${perf}"
}
})
}]...) : {
"csi-cinder-retain.yaml" : templatefile("${path.module}/manifests/csi-cinder-sc.yaml.tpl", {
name = "csi-cinder-retain",
reclaimPolicy = "Retain"
is_default = true
parameters = {}
}),
"csi-cinder-delete.yaml" : templatefile("${path.module}/manifests/csi-cinder-sc.yaml.tpl", {
name = "csi-cinder-delete"
reclaimPolicy = "Delete"
is_default = false
parameters = {}
})
},
{
for f in fileset(path.module, "manifests/*.{yml,yaml}") : basename(f) => file("${path.module}/${f}")
},
Expand Down
10 changes: 0 additions & 10 deletions manifests/csi-cinder-delete.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-cinder-retain
name: ${name}
annotations:
%{~ if is_default ~}
storageclass.kubernetes.io/is-default-class: "true"
%{~ endif ~}
provisioner: cinder.csi.openstack.org
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
reclaimPolicy: Retain
reclaimPolicy: ${reclaimPolicy}
parameters:
availability: nova
%{~ for k, v in parameters ~}
${k}: ${v}
%{~ endfor ~}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,8 @@ variable "ff_wait_ready" {
type = bool
default = true
}

variable "ff_infomaniak_sc" {
type = bool
default = false
}

0 comments on commit aec06ad

Please sign in to comment.