Terraform Modules to create Sample AKS Cluster
Download terraform binary
Configure the environment variables
export $AZURE_STORAGE_RG_NAME=Storage Account Resource Group Name
export $AZURE_REGION=Azure Deployment Region
export $AZURE_STORAGE_NAME=Storage Account Name
export $AZURE_STORAGE_SKU=Storage Account SKU
Create the Storage Account for Terraform Remote Backend
./script/createStorageAccount.sh
export AZURE_STORAGE_KEY= Storage Key of Account Created previously
./script/createStorageAccount.sh
aks
- Creates a Basic Dev Cluster within a VNETaks_private
- Creates a Production like Cluster within a VNET, private enabled and with RBACacr
- Creates an ACR Container Registry limited to private access.monitor
- Creates basic Azure Log Analytics Identities.roles
- Creates Roles for Minimum Access for the scope of AKS Clustersnetworking
- Creates networking elements - VNET, Subnet, IP's and Gateways
Initialize the terraform
terraform init env/{env}/
Run Terraform Plan
terraform plan env/{env}/
Apply the Terraform Plan
terraform apply env/{env}/
Variables need to be configured in variables.tf file or can be entered at the terraform cli. Also, {env} -> Dev, Prod
admin_user
: Admin User for SSH into AKS nodesdefault_node_pool_node_count
: Number of VM's for Default Node Pooldefault_node_pool_vm_size
: VM SKU for Default Node Poolenable_role_based_access_control
: Boolean Flag to enable Role based access -on AKS Clusterload_balancer_sku
: SKU for the ILB for AKS Nodeprefix
: Common prefix for all Resourcesssh_key
: SSH Key for Admin User for SSH Access into AKS nodes.user_node_pool_node_count
: Number of VM's for user Node Pooluser_node_pool_vm_size
: VM SKU for user Node Pool
Additional Variables for Production Environment
aad_admin_group_object_ids
: Set of Object ID's for Admin access to Clusterdefault_node_pool_cluster_auto_scaling_max_count
: Max Instances in ASG for Default Node Pooldefault_node_pool_cluster_auto_scaling_min_count
: Min Instances in ASG for - Default Node Pooluser_node_pool_cluster_auto_scaling_max_count
: Max Instances in ASG for User Node Pooluser_node_pool_cluster_auto_scaling_min_count
: Min Instances in ASG for User Node Pool
1.0.0 Basic Version of the Application. Has a bug with the roles module