Skip to content

Commit

Permalink
feat(storage_profile): add support for CSI arguments (#282)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Aeschlimann <aero0730@gmail.com>
  • Loading branch information
aescrob and Robert Aeschlimann authored Dec 26, 2022
1 parent 6b365c7 commit 16aac71
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ No modules.
| <a name="input_secret_rotation_enabled"></a> [secret\_rotation\_enabled](#input\_secret\_rotation\_enabled) | Is secret rotation enabled? This variable is only used when `key_vault_secrets_provider_enabled` is `true` and defaults to `false` | `bool` | `false` | no |
| <a name="input_secret_rotation_interval"></a> [secret\_rotation\_interval](#input\_secret\_rotation\_interval) | The interval to poll for secret rotation. This attribute is only set when `secret_rotation` is `true` and defaults to `2m` | `string` | `"2m"` | no |
| <a name="input_sku_tier"></a> [sku\_tier](#input\_sku\_tier) | The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free` and `Paid` | `string` | `"Free"` | no |
| <a name="input_storage_profile_blob_driver_enabled"></a> [storage\_profile\_blob\_driver\_enabled](#input\_storage\_profile\_blob\_driver\_enabled) | (Optional) Is the Blob CSI driver enabled? Defaults to `false` | `bool` | `false` | no |
| <a name="input_storage_profile_disk_driver_enabled"></a> [storage\_profile\_disk\_driver\_enabled](#input\_storage\_profile\_disk\_driver\_enabled) | (Optional) Is the Disk CSI driver enabled? Defaults to `true` | `bool` | `true` | no |
| <a name="input_storage_profile_disk_driver_version"></a> [storage\_profile\_disk\_driver\_version](#input\_storage\_profile\_disk\_driver\_version) | (Optional) Disk CSI Driver version to be used. Possible values are `v1` and `v2`. Defaults to `v1`. | `string` | `"v1"` | no |
| <a name="input_storage_profile_enabled"></a> [storage\_profile\_enabled](#input\_storage\_profile\_enabled) | Enable storage profile | `bool` | `false` | no |
| <a name="input_storage_profile_file_driver_enabled"></a> [storage\_profile\_file\_driver\_enabled](#input\_storage\_profile\_file\_driver\_enabled) | (Optional) Is the File CSI driver enabled? Defaults to `true` | `bool` | `true` | no |
| <a name="input_storage_profile_snapshot_controller_enabled"></a> [storage\_profile\_snapshot\_controller\_enabled](#input\_storage\_profile\_snapshot\_controller\_enabled) | (Optional) Is the Snapshot Controller enabled? Defaults to `true` | `bool` | `true` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Any tags that should be present on the AKS cluster resources | `map(string)` | `{}` | no |
| <a name="input_ultra_ssd_enabled"></a> [ultra\_ssd\_enabled](#input\_ultra\_ssd\_enabled) | (Optional) Used to specify whether the UltraSSD is enabled in the Default Node Pool. Defaults to false. | `bool` | `false` | no |
| <a name="input_vnet_subnet_id"></a> [vnet\_subnet\_id](#input\_vnet\_subnet\_id) | (Optional) The ID of a Subnet where the Kubernetes Node Pool should exist. Changing this forces a new resource to be created. | `string` | `null` | no |
Expand Down
11 changes: 11 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,17 @@ resource "azurerm_kubernetes_cluster" "main" {
client_secret = var.client_secret
}
}
dynamic "storage_profile" {
for_each = var.storage_profile_enabled ? ["storage_profile"] : []

content {
blob_driver_enabled = var.storage_profile_blob_driver_enabled
disk_driver_enabled = var.storage_profile_disk_driver_enabled
disk_driver_version = var.storage_profile_disk_driver_version
file_driver_enabled = var.storage_profile_file_driver_enabled
snapshot_controller_enabled = var.storage_profile_snapshot_controller_enabled
}
}

lifecycle {
precondition {
Expand Down
37 changes: 37 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,43 @@ variable "sku_tier" {
default = "Free"
}

variable "storage_profile_blob_driver_enabled" {
type = bool
description = "(Optional) Is the Blob CSI driver enabled? Defaults to `false`"
default = false
}

variable "storage_profile_disk_driver_enabled" {
type = bool
description = "(Optional) Is the Disk CSI driver enabled? Defaults to `true`"
default = true
}

variable "storage_profile_disk_driver_version" {
type = string
description = "(Optional) Disk CSI Driver version to be used. Possible values are `v1` and `v2`. Defaults to `v1`."
default = "v1"
}

variable "storage_profile_enabled" {
description = "Enable storage profile"
type = bool
default = false
nullable = false
}

variable "storage_profile_file_driver_enabled" {
type = bool
description = "(Optional) Is the File CSI driver enabled? Defaults to `true`"
default = true
}

variable "storage_profile_snapshot_controller_enabled" {
type = bool
description = "(Optional) Is the Snapshot Controller enabled? Defaults to `true`"
default = true
}

variable "tags" {
type = map(string)
description = "Any tags that should be present on the AKS cluster resources"
Expand Down

0 comments on commit 16aac71

Please sign in to comment.