Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling blob storage in AKS by default #5

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Truefoundry Azure Cluster Module

| Name | Source | Version |
|------|--------|---------|
| <a name="module_aks"></a> [aks](#module\_aks) | Azure/aks/azurerm | 7.2.0 |
| <a name="module_aks"></a> [aks](#module\_aks) | Azure/aks/azurerm | 7.4.0 |

## Resources

Expand All @@ -32,25 +32,31 @@ Truefoundry Azure Cluster Module

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_allowed_ip_ranges"></a> [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | allowed IP ranges to connect to the cluster | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | whether the cluster is control plane | `bool` | n/a | yes |
| <a name="input_disk_size"></a> [disk\_size](#input\_disk\_size) | disk size of the initial node pool in GB | `string` | `"100"` | no |
| <a name="input_allowed_ip_ranges"></a> [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | Allowed IP ranges to connect to the cluster | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Whether the cluster is control plane | `bool` | n/a | yes |
| <a name="input_disk_driver_version"></a> [disk\_driver\_version](#input\_disk\_driver\_version) | Version of disk driver. Supported values `v1` and `v2` | `string` | `"v1"` | no |
| <a name="input_disk_size"></a> [disk\_size](#input\_disk\_size) | Disk size of the initial node pool in GB | `string` | `"100"` | no |
| <a name="input_dns_ip"></a> [dns\_ip](#input\_dns\_ip) | IP from service CIDR used for internal DNS | `string` | `"10.255.0.10"` | no |
| <a name="input_enable_blob_driver"></a> [enable\_blob\_driver](#input\_enable\_blob\_driver) | Enable blob storage provider | `bool` | `true` | no |
| <a name="input_enable_disk_driver"></a> [enable\_disk\_driver](#input\_enable\_disk\_driver) | Enable disk storage provider | `bool` | `true` | no |
| <a name="input_enable_file_driver"></a> [enable\_file\_driver](#input\_enable\_file\_driver) | Enable file storage provider | `bool` | `true` | no |
| <a name="input_enable_snapshot_controller"></a> [enable\_snapshot\_controller](#input\_enable\_snapshot\_controller) | Enable snapshot controller | `bool` | `true` | no |
| <a name="input_enable_storage_profile"></a> [enable\_storage\_profile](#input\_enable\_storage\_profile) | Enable storage profile for the cluster. If disabled `enable_blob_driver`, `enable_file_driver`, `enable_disk_driver` and `enable_snapshot_controller` will have no impact | `bool` | `true` | no |
| <a name="input_intial_node_pool_instance_type"></a> [intial\_node\_pool\_instance\_type](#input\_intial\_node\_pool\_instance\_type) | Instance size of the initial node pool | `string` | `"Standard_D2s_v5"` | no |
| <a name="input_intial_node_pool_spot_instance_type"></a> [intial\_node\_pool\_spot\_instance\_type](#input\_intial\_node\_pool\_spot\_instance\_type) | Instance size of the initial node pool | `string` | `"Standard_D4s_v5"` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | version of the kubernetes engine | `string` | `"1.26"` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Version of the kubernetes engine | `string` | `"1.26"` | no |
| <a name="input_location"></a> [location](#input\_location) | Location of the resource group | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name of the cluster | `string` | n/a | yes |
| <a name="input_network_plugin"></a> [network\_plugin](#input\_network\_plugin) | network plugin to use for cluster | `string` | `"kubenet"` | no |
| <a name="input_oidc_issuer_enabled"></a> [oidc\_issuer\_enabled](#input\_oidc\_issuer\_enabled) | enable OIDC for the cluster | `bool` | `true` | no |
| <a name="input_pod_cidr"></a> [pod\_cidr](#input\_pod\_cidr) | CIDR of the pod | `string` | `"10.244.0.0/16"` | no |
| <a name="input_network_plugin"></a> [network\_plugin](#input\_network\_plugin) | Network plugin to use for cluster | `string` | `"kubenet"` | no |
| <a name="input_oidc_issuer_enabled"></a> [oidc\_issuer\_enabled](#input\_oidc\_issuer\_enabled) | Enable OIDC for the cluster | `bool` | `true` | no |
| <a name="input_pod_cidr"></a> [pod\_cidr](#input\_pod\_cidr) | CIDR of the pod in cluster | `string` | `"10.244.0.0/16"` | no |
| <a name="input_private_cluster_enabled"></a> [private\_cluster\_enabled](#input\_private\_cluster\_enabled) | Private cluster | `bool` | `false` | no |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Name of the resource group | `string` | n/a | yes |
| <a name="input_service_cidr"></a> [service\_cidr](#input\_service\_cidr) | service CIDR | `string` | `"10.255.0.0/16"` | no |
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet Id for the cluster. | `string` | n/a | yes |
| <a name="input_service_cidr"></a> [service\_cidr](#input\_service\_cidr) | CIDR of the services in cluster | `string` | `"10.255.0.0/16"` | no |
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet Id for the cluster | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
| <a name="input_vnet_id"></a> [vnet\_id](#input\_vnet\_id) | Vnet ID for the cluster | `string` | n/a | yes |
| <a name="input_workload_identity_enabled"></a> [workload\_identity\_enabled](#input\_workload\_identity\_enabled) | enable workload identity in the cluster | `bool` | `true` | no |
| <a name="input_workload_identity_enabled"></a> [workload\_identity\_enabled](#input\_workload\_identity\_enabled) | Enable workload identity in the cluster | `bool` | `true` | no |

## Outputs

Expand Down
10 changes: 9 additions & 1 deletion aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azurerm_role_assignment" "network_contributor_cluster" {

module "aks" {
source = "Azure/aks/azurerm"
version = "7.2.0"
version = "7.4.0"
resource_group_name = var.resource_group_name
cluster_name = var.name
location = var.location
Expand Down Expand Up @@ -53,6 +53,14 @@ module "aks" {
identity_type = "UserAssigned"
kubernetes_version = var.kubernetes_version

# storage
storage_profile_blob_driver_enabled = var.enable_blob_driver
storage_profile_disk_driver_enabled = var.enable_disk_driver
storage_profile_disk_driver_version = var.disk_driver_version
storage_profile_file_driver_enabled = var.enable_file_driver
storage_profile_snapshot_controller_enabled = var.enable_snapshot_controller
storage_profile_enabled = var.enable_storage_profile

# network configuration
network_plugin = var.network_plugin
vnet_subnet_id = var.subnet_id
Expand Down
55 changes: 45 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ variable "name" {
type = string
}
variable "kubernetes_version" {
description = "version of the kubernetes engine"
description = "Version of the kubernetes engine"
default = "1.26"
type = string
}

variable "oidc_issuer_enabled" {
description = "enable OIDC for the cluster"
description = "Enable OIDC for the cluster"
default = true
type = bool
}

variable "disk_size" {
description = "disk size of the initial node pool in GB"
description = "Disk size of the initial node pool in GB"
default = "100"
type = string
}
Expand All @@ -37,16 +37,51 @@ variable "intial_node_pool_spot_instance_type" {
}

variable "workload_identity_enabled" {
description = "enable workload identity in the cluster"
description = "Enable workload identity in the cluster"
default = true
type = bool
}

variable "control_plane" {
description = "whether the cluster is control plane"
description = "Whether the cluster is control plane"
type = bool

}

variable "enable_storage_profile" {
description = "Enable storage profile for the cluster. If disabled `enable_blob_driver`, `enable_file_driver`, `enable_disk_driver` and `enable_snapshot_controller` will have no impact"
type = bool
default = true
}

variable "enable_blob_driver" {
description = "Enable blob storage provider"
type = bool
default = true
}

variable "enable_file_driver" {
description = "Enable file storage provider"
type = bool
default = true
}

variable "enable_disk_driver" {
description = "Enable disk storage provider"
type = bool
default = true
}

variable "disk_driver_version" {
description = "Version of disk driver. Supported values `v1` and `v2`"
type = string
default = "v1"
}
variable "enable_snapshot_controller" {
description = "Enable snapshot controller"
type = bool
default = true
}
################################################################################
# Network
################################################################################
Expand All @@ -57,24 +92,24 @@ variable "vnet_id" {
}

variable "subnet_id" {
description = "Subnet Id for the cluster."
description = "Subnet Id for the cluster"
type = string
}

variable "network_plugin" {
description = "network plugin to use for cluster"
description = "Network plugin to use for cluster"
type = string
default = "kubenet"
}

variable "pod_cidr" {
description = "CIDR of the pod"
description = "CIDR of the pod in cluster"
default = "10.244.0.0/16"
type = string
}

variable "service_cidr" {
description = "service CIDR"
description = "CIDR of the services in cluster"
default = "10.255.0.0/16"
type = string
}
Expand All @@ -86,7 +121,7 @@ variable "dns_ip" {
}

variable "allowed_ip_ranges" {
description = "allowed IP ranges to connect to the cluster"
description = "Allowed IP ranges to connect to the cluster"
default = ["0.0.0.0/0"]
type = list(string)
}
Expand Down