From 8a4f8404d0ac2ccf7320c9dccc27374c8693336f Mon Sep 17 00:00:00 2001 From: tomas-balaz Date: Mon, 12 Sep 2022 12:01:39 +0200 Subject: [PATCH] feat: add StorageClasses creation --- README.md | 2 ++ values.tf | 1 + variables.tf | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/README.md b/README.md index 2580550..800ff5e 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,8 @@ No modules. | [service\_account\_create](#input\_service\_account\_create) | Whether to create Service Account | `bool` | `true` | no | | [service\_account\_name](#input\_service\_account\_name) | The k8s EBS CSI driver service account name | `string` | `"aws-ebs-csi-driver"` | no | | [settings](#input\_settings) | Additional helm sets which will be passed to the Helm chart values, see https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/charts/aws-ebs-csi-driver | `map(any)` | `{}` | no | +| [storage\_classes](#input\_storage\_classes) | List of the custom Storage Classes definitions | `list` |
[
{
"allowVolumeExpansion": true,
"annotations": {
"storageclass.kubernetes.io/is-default-class": "true"
},
"name": "ebs-csi-gp3",
"parameters": {
"encrypted": "true",
"type": "gp3"
},
"reclaimPolicy": "Delete",
"volumeBindingMode": "WaitForFirstConsumer"
}
]
| no | +| [storage\_classes\_create](#input\_storage\_classes\_create) | Whether to create Storage Classes | `bool` | `true` | no | | [values](#input\_values) | Additional yaml encoded values which will be passed to the Helm chart, see https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/charts/aws-ebs-csi-driver | `string` | `""` | no | ## Outputs diff --git a/values.tf b/values.tf index 3f17066..cbc2f41 100644 --- a/values.tf +++ b/values.tf @@ -18,6 +18,7 @@ locals { } } } + "storageClasses" : var.storage_classes_create ? var.storage_classes : [] }) } diff --git a/variables.tf b/variables.tf index e809a75..a230ff2 100644 --- a/variables.tf +++ b/variables.tf @@ -102,6 +102,31 @@ variable "irsa_tags" { description = "IRSA resources tags" } +variable "storage_classes_create" { + type = bool + default = true + description = "Whether to create Storage Classes" +} + +variable "storage_classes" { + default = [ + { + "name" : "ebs-csi-gp3" + "annotations" : { + "storageclass.kubernetes.io/is-default-class" : "true" + } + "allowVolumeExpansion" : true + "volumeBindingMode" : "WaitForFirstConsumer" + "reclaimPolicy" : "Delete" + "parameters" : { + "type" : "gp3" + "encrypted" : "true" + } + } + ] + description = "List of the custom Storage Classes definitions" +} + variable "argo_namespace" { type = string default = "argo"