Azure Kubernetes Service
This is the repository for our Azure Kubernetes Service (AKS) Terraform module.
Requirements
Name | Version |
---|---|
azurerm | >3.21.1 |
Examples
Basic example
module "kubernetes" {
source = "amestofortytwo/kubernetes"
version = "1.2.0"
name = "demo-prod-westeu"
resource_group_name = azurerm_resource_group.demo.name
location = azurerm_resource_group.demo.location
tags = {
environment = "production"
}
}
Advanced Example
module "kubernetes" {
source = "amestofortytwo/kubernetes"
version = "1.2.0"
name = "demo-prod-westeu"
resource_group_name = azurerm_resource_group.demo.name
location = azurerm_resource_group.demo.location
service_principal = {
client_id = "00000000-0000-0000-0000-000000000000"
client_secret = "client_secret_value"
}
automatic_bump_kubernetes_version = {
enabled = true
version_prefix = "1.23"
include_preview = false
}
additional_node_pools = [
{ name = "pool1" },
{ name = "pool2" }
]
tags = {
environment = "production"
}
}
Providers
Name | Version |
---|---|
azurerm | >3.21.1 |
Modules
No modules.
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
aad_rbac | (Optional) Used to fill the azure_active_directory_role_based_access_control block for the Kubernetes cluster. If nothing is specified, managed AAD RBAC will be enabled. If managed is set to true, the admin_group_object_ids properties can be specified to a group that will have admin access to the cluster. |
object({ |
{ |
no |
additional_node_pools | (Optional) A list of additional node pools to add to the Kubernetes cluster. Each node pool can have the following properties: name - (Required) The name of the node pool. node_count - (optional) The number of nodes in the node pool, defaults to 1. vm_size - (optional) The size of the virtual machines to use for the node pool, defaults to the same as the default node pool. |
list(object({ |
[] |
no |
api_server_authorized_ip_ranges | (Optional) A list of authorized IP ranges to access the Kubernetes API server | list(string) |
null |
no |
automatic_bump_kubernetes_version | Automatically bump the Kubernetes version to the latest available version | object({ |
{ |
no |
azure_policy_enabled | Enable or disable Azure Policy for the cluster. Defaults to true. | bool |
true |
no |
default_node_pool | (Optional) The default node pool for the Kubernetes cluster. If not specified, the default node pool will have one Standard_d2s_v4 node. |
object({ |
{ |
no |
identity | (Optional) The identity block for the Kubernetes cluster. If not specified, the identity will be of type SystemAssigned. |
object({ |
{ |
no |
ingress_application_gateway | Values used for deployment of the ingress application gateway | object({ |
null |
no |
kubernetes_version | Kubernetes version to use for the cluster | string |
null |
no |
location | The location where all resources will be created | string |
n/a | yes |
name | The name of the managed Kubernetes cluster. Will prefix the name of the cluster with aks- . |
string |
n/a | yes |
network_profile | (Optional) The network profile block for the Kubernetes cluster. If not specified, the network profile will be of type Azure. |
object({ |
{ |
no |
resource_group_name | Name of the resource group to create the resources in | string |
n/a | yes |
service_principal | (Optional) The service principal block for the Kubernetes cluster. Do not specify this block if you want already defined the identity block, or if you want to use the SystemAssigned identity. |
object({ |
null |
no |
tags | A mapping of tags to assign to the resources | map(string) |
n/a | yes |
workload_identity_enabled | (Optional) Enable or disable workload identity for the cluster. Enabling this also sets oidc_issuer_enabled to true. | bool |
null |
no |
Outputs
No outputs.
Resources
Name | Type |
---|---|
azurerm_kubernetes_cluster.main | resource |
azurerm_kubernetes_cluster_node_pool.additional | resource |
azurerm_kubernetes_service_versions.current | data source |