diff --git a/README.adoc b/README.adoc index 327c54b..02918bb 100644 --- a/README.adoc +++ b/README.adoc @@ -206,7 +206,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v2.4.0"` +Default: `"v3.1.0"` ==== [[input_helm_values]] <> @@ -248,6 +248,44 @@ Type: `map(string)` Default: `{}` +==== [[input_resources]] <> + +Description: Resource limits and requests for aws-efs-csi-driver's components. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values." + +NOTE: These are the same values as the defaults on the Helm chart aws-efs-csi-driver. + +Type: +[source,hcl] +---- +object({ + + controller = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + node = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + }) +---- + +Default: `{}` + ==== [[input_iam_role_arn]] <> Description: ARN of an OIDC assumable IAM role that has access to the EFS filesystem. When specified, this is added as an annotation to the EFS CSI driver controller ServiceAccount, to allow the driver to manage EFS access points for dynamic volumes provisioning. @@ -353,7 +391,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v2.4.0"` +|`"v3.1.0"` |no |[[input_helm_values]] <> @@ -394,6 +432,45 @@ object({ |`{}` |no +|[[input_resources]] <> +|Resource limits and requests for aws-efs-csi-driver's components. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values." + +NOTE: These are the same values as the defaults on the Helm chart aws-efs-csi-driver. + +| + +[source] +---- +object({ + + controller = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + node = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + }) +---- + +|`{}` +|no + |[[input_efs_file_system_id]] <> |EFS Filesystem ID to use by the CSI driver to create volumes. |`string` diff --git a/locals.tf b/locals.tf index b25dad7..39b7731 100644 --- a/locals.tf +++ b/locals.tf @@ -15,6 +15,16 @@ locals { "eks.amazonaws.com/role-arn" = var.iam_role_arn != null ? var.iam_role_arn : module.iam_assumable_role_efs.iam_role_arn } } + resources = { + requests = { for k, v in var.resources.controller.requests : k => v if v != null } + limits = { for k, v in var.resources.controller.limits : k => v if v != null } + } + } + node = { + resources = { + requests = { for k, v in var.resources.node.requests : k => v if v != null } + limits = { for k, v in var.resources.node.limits : k => v if v != null } + } } } }] diff --git a/variables.tf b/variables.tf index ab6d328..fa53369 100644 --- a/variables.tf +++ b/variables.tf @@ -62,6 +62,40 @@ variable "dependency_ids" { ## Module variables ####################### +variable "resources" { + description = <<-EOT + Resource limits and requests for aws-efs-csi-driver's components. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values." + + NOTE: These are the same values as the defaults on the Helm chart aws-efs-csi-driver. + EOT + type = object({ + + controller = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + node = optional(object({ + requests = optional(object({ + cpu = optional(string, "10m") + memory = optional(string, "40Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }), {}) + + }) + default = {} +} + variable "efs_file_system_id" { description = "EFS Filesystem ID to use by the CSI driver to create volumes." type = string