This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| output "azurerm_kubernetes_cluster_id" { | |
| value = azurerm_kubernetes_cluster.cluster.id | |
| } | |
| output "azurerm_kubernetes_cluster_fqdn" { | |
| value = azurerm_kubernetes_cluster.cluster.fqdn | |
| } | |
| output "azurerm_kubernetes_cluster_node_resource_group" { | |
| value = azurerm_kubernetes_cluster.cluster.node_resource_group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cluster Resource Group | |
| resource "azurerm_resource_group" "aks" { | |
| name = var.resource_group_name | |
| location = var.location | |
| } | |
| # AKS Cluster Network | |
| module "aks_network" { | |
| source = "../modules/aks_network" | |
| subnet_name = var.subnet_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| variable "dns_prefix" { | |
| description = "DNS prefix" | |
| } | |
| variable "location" { | |
| description = "azure location to deploy resources" | |
| } | |
| variable "cluster_name" { | |
| description = "AKS cluster name" | |
| } | |
| variable "resource_group_name" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cluster Resource Group | |
| resource "azurerm_resource_group" "aks" { | |
| name = var.resource_group_name | |
| location = var.location | |
| } | |
| # AKS Cluster Network | |
| module "aks_network" { | |
| source = "../modules/aks_network" | |
| subnet_name = var.subnet_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: contoso-cluster-admins | |
| roleRef: | |
| apiGroup: rbac.authorization.k8s.io | |
| kind: ClusterRole | |
| name: cluster-admin | |
| subjects: | |
| - apiGroup: rbac.authorization.k8s.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: NetworkPolicy | |
| apiVersion: networking.k8s.io/v1 | |
| metadata: | |
| name: backend-policy | |
| namespace: development | |
| spec: | |
| podSelector: | |
| matchLabels: | |
| app: webapp | |
| role: backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: NetworkPolicy | |
| apiVersion: networking.k8s.io/v1 | |
| metadata: | |
| name: backend-policy | |
| namespace: development | |
| spec: | |
| podSelector: | |
| matchLabels: | |
| app: webapp | |
| role: backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terraform { | |
| backend "azurerm" {} | |
| } | |
| provider "azurerm" { | |
| version = "~> 2.4" | |
| features {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "azurerm_kubernetes_cluster" "cluster" { | |
| name = var.cluster_name | |
| location = var.location | |
| resource_group_name = var.resource_group_name | |
| dns_prefix = var.dns_prefix | |
| kubernetes_version = var.kubernetes_version | |
| default_node_pool { | |
| name = var.agent_pool_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "azurerm_kubernetes_cluster" "cluster" { | |
| name = var.cluster_name | |
| location = var.location | |
| resource_group_name = var.resource_group_name | |
| dns_prefix = var.dns_prefix | |
| kubernetes_version = var.kubernetes_version | |
| agent_pool_profile { | |
| name = var.agent_pool_name | |
| count = var.node_count |
OlderNewer