Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AutoScalining and node pull features. #8

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions _data.tf
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
data "azurerm_subnet" "subnet" {
count = var.subnet_network_name == "" ? 1 : 0
name = "subnet-k8s"
virtual_network_name = var.virtual_network_name == "" ? azurerm_virtual_network.vnet[0].name : var.virtual_network_name
resource_group_name = azurerm_resource_group.rg.name
}
39 changes: 38 additions & 1 deletion _local.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
locals {
subnet_id = length(data.azurerm_subnet.subnet) > 0 ? data.azurerm_subnet.subnet[0].id : null
default_agent_profile = {
name = var.default_node_pool.name
node_count = var.default_node_pool.node_count
vm_size = var.default_node_pool.vm_size
os_type = var.default_node_pool.os_type
workload_runtime = var.default_node_pool.workload_runtime
zones = var.default_node_pool.zones
enable_auto_scaling = var.default_node_pool.enable_auto_scaling
min_count = var.default_node_pool.min_count
max_count = var.default_node_pool.max_count
type = var.default_node_pool.type
node_labels = var.default_node_pool.node_labels
orchestrator_version = var.default_node_pool.orchestrator_version
priority = var.default_node_pool.priority
enable_host_encryption = var.default_node_pool.enable_host_encryption
eviction_policy = var.default_node_pool.eviction_policy
vnet_subnet_id = var.vnet_subnet_id
max_pods = var.default_node_pool.max_pods
os_disk_type = var.default_node_pool.os_disk_type
os_disk_size_gb = var.default_node_pool.os_disk_size_gb
enable_node_public_ip = var.default_node_pool.enable_node_public_ip
scale_down_mode = var.default_node_pool.scale_down_mode
}

default_node_pool = merge(local.default_agent_profile, var.default_node_pool)

private_dns_zone = var.private_dns_zone_type == "Custom" ? var.private_dns_zone_id : var.private_dns_zone_type

default_no_proxy_url_list = [
var.vnet_address_space,
var.aks_pod_cidr,
var.service_cidr,
"localhost",
"konnectivity",
"127.0.0.1", # Localhost
"168.63.129.16", # Azure platform global VIP (https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16)
"169.254.169.254", # Azure Instance Metadata Service (IMDS)
]
}
7 changes: 6 additions & 1 deletion _output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ output "kube_config_file" {

output "cluster_name" {
description = "Cluster name to be used in the context of kubectl"
value = azurerm_kubernetes_cluster.cluster.name
value = azurerm_kubernetes_cluster.aks_cluster.name
}

output "cluster_id" {
description = "Describe the Cluster ID"
value = azurerm_kubernetes_cluster.aks_cluster.id
}

Loading
Loading