Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122784
D7488.id27158.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D7488.id27158.diff
View Options
diff --git a/azure/terraform/modules/kubernetes/main.tf b/azure/terraform/modules/kubernetes/main.tf
--- a/azure/terraform/modules/kubernetes/main.tf
+++ b/azure/terraform/modules/kubernetes/main.tf
@@ -1,12 +1,12 @@
-
resource "azurerm_kubernetes_cluster" "aks_cluster" {
name = var.cluster_name
resource_group_name = data.azurerm_resource_group.aks_rg.name
location = data.azurerm_resource_group.aks_rg.location
dns_prefix = var.cluster_name
+ node_resource_group = "${var.cluster_name}-internal"
default_node_pool {
- name = "default"
+ name = "default"
# node_count = 1
vm_size = var.node_type
enable_auto_scaling = true
@@ -30,8 +30,9 @@
private_cluster_enabled = true
network_profile {
- network_plugin = "kubenet"
- network_policy = "calico"
+ network_plugin = "kubenet"
+ network_policy = "calico"
+ load_balancer_sku = "Standard" # needed to assign a private ip address
}
}
@@ -48,3 +49,11 @@
subresource_names = ["management"]
}
}
+
+resource "azurerm_public_ip" "aks_cluster_public_ip" {
+ name = "${var.cluster_name}_ip"
+ resource_group_name = azurerm_kubernetes_cluster.aks_cluster.node_resource_group
+ location = data.azurerm_resource_group.aks_rg.location
+ allocation_method = "Static"
+ sku = "Standard"
+}
diff --git a/azure/terraform/modules/kubernetes/outputs.tf b/azure/terraform/modules/kubernetes/outputs.tf
--- a/azure/terraform/modules/kubernetes/outputs.tf
+++ b/azure/terraform/modules/kubernetes/outputs.tf
@@ -3,6 +3,7 @@
name: ${azurerm_kubernetes_cluster.aks_cluster.name}
internal_ip: ${azurerm_private_endpoint.aks_cluster_endpoint.private_service_connection.0.private_ip_address}
+public_ip: ${azurerm_public_ip.aks_cluster_public_ip.ip_address}
Execute the following command to add the credentials in your .kube/config:
az aks get-credentials --resource-group ${data.azurerm_resource_group.aks_rg.name} --name ${azurerm_kubernetes_cluster.aks_cluster.name}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 17 2024, 12:08 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222454
Attached To
D7488: aks: ensure there is a static ip assigned to the cluster
Event Timeline
Log In to Comment