From 62f0de1b76bbc37e99ca7d991e9664d81c435d05 Mon Sep 17 00:00:00 2001 From: Tom Archer Date: Fri, 4 Mar 2022 10:18:32 -0800 Subject: [PATCH] Added readme file --- .../main.tf | 9 ++++ .../output.tf | 4 ++ .../readme.md | 48 +++++++++++++++++++ .../terraform.tfvars | 2 - .../variables.tf | 7 +-- 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/readme.md diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf index 8159a8f9..857241e2 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf @@ -1,3 +1,12 @@ +resource "random_pet" "rg-name" { + prefix = var.name_prefix +} + +resource "azurerm_resource_group" "default" { + name = random_pet.rg-name.id + location = var.location +} + # Locals block for hardcoded names locals { backend_address_pool_name = "${azurerm_virtual_network.test.name}-beap" diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf index 6d59e7fb..96455e12 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf @@ -1,3 +1,7 @@ +output "resource_group_name" { + value = azurerm_resource_group.default.name +} + output "client_key" { value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_key } diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/readme.md b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/readme.md new file mode 100644 index 00000000..0d383813 --- /dev/null +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/readme.md @@ -0,0 +1,48 @@ +# Create an Application Gateway Ingress Controller in Azure Kubernetes Service using Terraform + +This template creates an Application Gateway Ingress Controller in Azure Kubernetes Service using Terraform. + +## Terraform resource types + +- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) +- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) +- [azurerm_user_assigned_identity](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/user_assigned_identity) +- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) +- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) +- [azurerm_public_ip](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip) +- [azurerm_application_gateway](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/application_gateway) +- [azurerm_role_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) +- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster) + +## Variables + +| Name | Description | Default value | +|-|-|-| +| `location` | (Optional) Azure Region in which to deploy these resources.| eastus | +| `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.| | +| `aks_service_principal_client_secret` | Secret of the service principal. Used by AKS to manage Azure. | | +| `aks_service_principal_object_id` | Object ID of the service principal. | | +| `virtual_network_name` | Virtual network name. | aksVirtualNetwork | +| `virtual_network_address_prefix` | VNET address prefix. | 15.0.0.0/8 | +| `aks_subnet_name` | Subnet name. | kubesubnet | +| `aks_subnet_address_prefix` | Subnet address prefix. | 15.0.0.0/16 | +| `app_gateway_subnet_address_prefix` | Subnet server IP address. | 15.1.0.0/16 | +| `app_gateway_name` | Name of the Application Gateway. | ApplicationGateway1 | +| `app_gateway_sku` | Name of the Application Gateway SKU. | Standard_v2 | +| `app_gateway_tier` | Tier of the Application Gateway tier. | Standard_v2 | +| `aks_name` | AKS cluster name. | aks-cluster1 | +| `aks_dns_prefix` | (Optional) DNS prefix to use with hosted Kubernetes API server FQDN. | aks | +| `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 | +| `aks_agent_count` | The number of agent nodes for the cluster. | 3 | +| `aks_agent_vm_size` | VM size. | Standard_D3_v2 | +| `kubernetes_version` | Kubernetes version | 1.11.5 | +| `aks_service_cidr` | CIDR notation IP range from which to assign service cluster IPs. | 10.0.0.0/16 | +| `aks_dns_service_ip` | DNS server IP address. | 10.0.0.10 | +| `aks_docker_bridge_cidr` | CIDR notation IP for Docker bridge. | 172.17.0.1/16 | +| `aks_enable_rbac` | Enable RBAC on the AKS cluster. | false | +| `vm_user_name` | User name for the VM. | vmuser1 | +| `public_ssh_key_path` | Public key path for SSH. | ~/.ssh/id_rsa.pub | + +## Example + +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). diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars index c516703b..f615cc5e 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars @@ -1,5 +1,3 @@ -resource_group_name = "" - location = "" aks_service_principal_app_id = "" diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf index 044807c6..7c48bd27 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf @@ -1,9 +1,6 @@ -variable "resource_group_name" { - description = "Name of the resource group." -} - variable "location" { - description = "Location of the cluster." + default = "eastus" + description = "Location of the resource." } variable "aks_service_principal_app_id" {