Skip to content

Instantly share code, notes, and snippets.

@mariojacobo
Last active July 7, 2020 22:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariojacobo/01708a83ce6db3056ebc6439a100cab2 to your computer and use it in GitHub Desktop.
Save mariojacobo/01708a83ce6db3056ebc6439a100cab2 to your computer and use it in GitHub Desktop.
provider "azurerm" {
version = "= 1.42.0"
}
resource "azurerm_resource_group" "example" {
name = "aksgroup"
location = "West Europe"
}
resource "azurerm_virtual_network" "example" {
name = "virtualNetwork1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
address_space = ["10.0.0.0/16"]
dns_servers = ["10.0.0.4", "10.0.0.5"]
}
resource "azurerm_subnet" "kubenet" {
name = "kubenet"
resource_group_name = azurerm_resource_group.example.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefix = "10.0.1.0/24"
}
resource "azurerm_kubernetes_cluster" "aks_cluster" {
name = "uat-ops-cluster"
location = "westeurope"
dns_prefix = "pkpuatops"
resource_group_name = azurerm_resource_group.example.name
node_resource_group = "test-aks-nodes"
kubernetes_version = "1.13.12"
addon_profile {
http_application_routing {
enabled = true
}
}
default_node_pool {
name = "appagentpool"
node_count = 1
vm_size = "Standard_D2s_v3"
os_disk_size_gb = 40
vnet_subnet_id = azurerm_subnet.kubenet.id
}
service_principal {
client_id = "ADD_SP_ID"
client_secret = "ADD_SP_SECRET"
}
network_profile {
network_plugin = "azure"
dns_service_ip = "15.0.0.10"
docker_bridge_cidr = "172.17.0.1/16"
service_cidr = "15.0.0.0/16"
load_balancer_sku = "Standard"
load_balancer_profile {
outbound_ip_address_ids = [azurerm_public_ip.example.id]
}
}
}
resource "azurerm_public_ip" "example" {
name = "acceptanceTestPublicIp1"
location = "West Europe"
resource_group_name = azurerm_resource_group.example.name
allocation_method = "Static"
sku = "Standard"
tags = {
environment = "Production"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment