Skip to content

Commit 62f0de1

Browse files
committed
Added readme file
1 parent 679c91f commit 62f0de1

5 files changed

Lines changed: 63 additions & 7 deletions

File tree

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
resource "random_pet" "rg-name" {
2+
prefix = var.name_prefix
3+
}
4+
5+
resource "azurerm_resource_group" "default" {
6+
name = random_pet.rg-name.id
7+
location = var.location
8+
}
9+
110
# Locals block for hardcoded names
211
locals {
312
backend_address_pool_name = "${azurerm_virtual_network.test.name}-beap"

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
output "resource_group_name" {
2+
value = azurerm_resource_group.default.name
3+
}
4+
15
output "client_key" {
26
value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_key
37
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Create an Application Gateway Ingress Controller in Azure Kubernetes Service using Terraform
2+
3+
This template creates an Application Gateway Ingress Controller in Azure Kubernetes Service using Terraform.
4+
5+
## Terraform resource types
6+
7+
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
8+
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
9+
- [azurerm_user_assigned_identity](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/user_assigned_identity)
10+
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
11+
- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet)
12+
- [azurerm_public_ip](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip)
13+
- [azurerm_application_gateway](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/application_gateway)
14+
- [azurerm_role_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment)
15+
- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster)
16+
17+
## Variables
18+
19+
| Name | Description | Default value |
20+
|-|-|-|
21+
| `location` | (Optional) Azure Region in which to deploy these resources.| eastus |
22+
| `aks_service_principal_app_id` | Application ID/Client ID of the service principal. Used by AKS to manage AKS related resources on Azure like vms, subnets.| |
23+
| `aks_service_principal_client_secret` | Secret of the service principal. Used by AKS to manage Azure. | |
24+
| `aks_service_principal_object_id` | Object ID of the service principal. | |
25+
| `virtual_network_name` | Virtual network name. | aksVirtualNetwork |
26+
| `virtual_network_address_prefix` | VNET address prefix. | 15.0.0.0/8 |
27+
| `aks_subnet_name` | Subnet name. | kubesubnet |
28+
| `aks_subnet_address_prefix` | Subnet address prefix. | 15.0.0.0/16 |
29+
| `app_gateway_subnet_address_prefix` | Subnet server IP address. | 15.1.0.0/16 |
30+
| `app_gateway_name` | Name of the Application Gateway. | ApplicationGateway1 |
31+
| `app_gateway_sku` | Name of the Application Gateway SKU. | Standard_v2 |
32+
| `app_gateway_tier` | Tier of the Application Gateway tier. | Standard_v2 |
33+
| `aks_name` | AKS cluster name. | aks-cluster1 |
34+
| `aks_dns_prefix` | (Optional) DNS prefix to use with hosted Kubernetes API server FQDN. | aks |
35+
| `aks_agent_os_disk_size` | Disk size (in GB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 applies the default disk size for that agentVMSize. | 40 |
36+
| `aks_agent_count` | The number of agent nodes for the cluster. | 3 |
37+
| `aks_agent_vm_size` | VM size. | Standard_D3_v2 |
38+
| `kubernetes_version` | Kubernetes version | 1.11.5 |
39+
| `aks_service_cidr` | CIDR notation IP range from which to assign service cluster IPs. | 10.0.0.0/16 |
40+
| `aks_dns_service_ip` | DNS server IP address. | 10.0.0.10 |
41+
| `aks_docker_bridge_cidr` | CIDR notation IP for Docker bridge. | 172.17.0.1/16 |
42+
| `aks_enable_rbac` | Enable RBAC on the AKS cluster. | false |
43+
| `vm_user_name` | User name for the VM. | vmuser1 |
44+
| `public_ssh_key_path` | Public key path for SSH. | ~/.ssh/id_rsa.pub |
45+
46+
## Example
47+
48+
To see how to run this example, see [Create an Application Gateway Ingress Controller in Azure Kubernetes Service using Terraform](https://docs.microsoft.com/azure/developer/terraform/create-k8s-cluster-with-aks-applicationgateway-ingress).

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
resource_group_name = "<Resource group name>"
2-
31
location = "<Resource group location>"
42

53
aks_service_principal_app_id = "<Service principal appId>"

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
variable "resource_group_name" {
2-
description = "Name of the resource group."
3-
}
4-
51
variable "location" {
6-
description = "Location of the cluster."
2+
default = "eastus"
3+
description = "Location of the resource."
74
}
85

96
variable "aks_service_principal_app_id" {

0 commit comments

Comments
 (0)