Skip to content

A terraform module for creating an AKS cluster on Azure.

Notifications You must be signed in to change notification settings

kjanshair/terraform-azurerm-aks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Create an Azure AKS (Azure Kubernetes Service) Cluster

Use this module to create a bare-metal managed AKS (Azure Kubernetes Service) cluster in Azure.

Sample Usage

The example given below uses other Terraform modules available on the registry for brevity.

resource "azurerm_resource_group" "aks-rg" {
  name     = "AKS"
  location = "${var.location_name}"
}

module "AKSVNet" {
    source              = "Azure/network/azurerm"
    vnet_name           = "AKSVNet"
    resource_group_name = "${azurerm_resource_group.aks-rg.name}"
    location            = "${azurerm_resource_group.aks-rg.location}"
    address_space       = "192.168.0.0/24"  # Change CIDR to suite your needs
    subnet_prefixes     = ["192.168.0.0/24"]  # Change CIDR to suite your needs
    subnet_names        = ["default"]
}

module "AKSNSG" {
    source                     = "Azure/network-security-group/azurerm"
    resource_group_name        = "${azurerm_resource_group.aks-rg.name}"
    location                   = "${azurerm_resource_group.aks-rg.location}"
    security_group_name        = "NSG"
    predefined_rules           = [
      {
        name                   = "SSH"
        priority               = "500"
        source_address_prefix  = ["*"]
        source_port_range      = "*"
      },
      {
        name                   = "HTTP"
        priority               = "501"
        source_address_prefix  = ["*"]
        source_port_range      = "*"
      },
    ]
}

module "kjanshair-cluster" {
  source = "kjanshair/aks/azurerm"
  ssh_key = "<your-public-ssh-key>"
  client_id = "<azure-client-id>"
  client_secret = "<azure-client-secret>"
  aks_subnet_id = "${module.AKSVNet.vnet_subnets[0]}"
  resource_group  = "${azurerm_resource_group.aks-rg.name}"
}

About

A terraform module for creating an AKS cluster on Azure.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages