Skip to content

Commit e91507f

Browse files
committed
updated examples
1 parent d66fe88 commit e91507f

File tree

6 files changed

+69
-62
lines changed

6 files changed

+69
-62
lines changed

BASTION_ACCESS.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,9 @@ This guide shows how to connect to a private AKS cluster using Azure Bastion, ei
99
- Azure CLI installed locally
1010
- Your SSH private key corresponding to jumpbox_ssh_public_key
1111

12-
## Option A: Run kubectl from the Jumpbox
1312

14-
1. Open an SSH session to the jumpbox via Bastion (Native client):
15-
```bash
16-
export RG="<RESOURCE_GROUP>"
17-
export BASTION="<BASTION_NAME>"
18-
export VM="<JUMPBOX_NAME>"
19-
export SSH_KEY="$HOME/.ssh/id_rsa"
20-
21-
VM_ID=$(az vm show -g "$RG" -n "$VM" --query id -o tsv)
22-
az network bastion ssh \
23-
--name "$BASTION" \
24-
--resource-group "$RG" \
25-
--target-resource-id "$VM_ID" \
26-
--auth-type ssh-key --username <ADMIN_USERNAME> --ssh-key $SSH_KEY
27-
```
28-
29-
2. Inside the VM, authenticate and fetch kubeconfig:
30-
```bash
31-
az login --use-device-code
32-
az account set --subscription "<SUBSCRIPTION_ID>"
33-
az aks get-credentials -g "<RESOURCE_GROUP>" -n "<AKS_NAME>" --overwrite-existing
34-
kubectl get nodes -o wide
35-
```
3613

37-
## Option B: Run kubectl from your local machine (Bastion tunneling)
14+
## Run kubectl from your local machine (Bastion tunneling)
3815

3916
1. Start SSH tunnel to the VM via Bastion:
4017
```bash

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,28 @@ module "quix_aks" {
4646
}
4747
```
4848

49+
### Private DNS Zone for Private Clusters
50+
51+
When deploying a private AKS cluster, you can control how the Private DNS Zone is managed using the `private_dns_zone_id` variable:
52+
53+
```hcl
54+
module "quix_aks" {
55+
# ...
56+
private_cluster_enabled = true
57+
58+
# Option 1: Let AKS manage the Private DNS Zone automatically (default)
59+
private_dns_zone_id = "System"
60+
61+
# Option 2: Disable Private DNS Zone management (manual DNS configuration required)
62+
# private_dns_zone_id = "None"
63+
64+
# Option 3: Use an existing Private DNS Zone (BYO)
65+
# private_dns_zone_id = "/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Network/privateDnsZones/privatelink.<region>.azmk8s.io"
66+
}
67+
```
68+
69+
**Note:** When using an existing Private DNS Zone (Option 3), the module automatically assigns the `Private DNS Zone Contributor` role to the AKS cluster identity.
70+
4971
## Tiered Storage module (tiered-storage)
5072

5173
Module documentation (inputs/outputs/resources):
@@ -115,7 +137,7 @@ module "quix_aks" {
115137
nodes_subnet_name = "Subnet-Nodes"
116138
nodes_subnet_cidr = "10.240.0.0/22"
117139
118-
nat_identity_name = "my-nat-id"
140+
identity_name = "my-nat-id"
119141
public_ip_name = "my-nat-ip"
120142
nat_gateway_name = "my-nat"
121143
availability_zone = "1"

examples/private-quix-infr-external-vnet/main.tf

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,10 @@ module "aks" {
7979
sku_tier = "Standard"
8080
private_cluster_enabled = true
8181

82-
vnet_name = "vnet-quix-private"
83-
vnet_address_space = ["10.240.0.0/16"]
84-
nodes_subnet_name = "Subnet-Nodes"
85-
nodes_subnet_cidr = "10.240.0.0/22"
82+
vnet_name = azurerm_virtual_network.ext.name
83+
nodes_subnet_name = azurerm_subnet.nodes_ext.name
8684

87-
# Reuse external VNet/Subnets
88-
vnet_id = azurerm_virtual_network.ext.id
89-
nodes_subnet_id = azurerm_subnet.nodes_ext.id
90-
91-
nat_identity_name = "quix-private-nat-id"
85+
identity_name = "quix-private-nat-id"
9286
public_ip_name = "quix-private-nat-ip"
9387
nat_gateway_name = "quix-private-nat"
9488
availability_zone = "2"
@@ -117,8 +111,6 @@ module "aks" {
117111
create_bastion_subnet = false
118112
enable_bastion = true
119113
bastion_name = "quix-bastion"
120-
# Reuse external Bastion subnet & IP
121-
bastion_subnet_id = azurerm_subnet.bastion_ext.id
122114

123115
jumpbox_name = "quix-jumpbox"
124116
jumpbox_vm_size = "Standard_B2s"

examples/private-quix-infr/main.tf

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,60 @@ resource "azurerm_resource_group" "this" {
2020
module "aks" {
2121
source = "../../modules/quix-aks"
2222

23+
# Core + RG
2324
name = "quix-aks-private"
2425
location = "westeurope"
2526
resource_group_name = "rg-quix-private"
2627
create_resource_group = false
2728
kubernetes_version = "1.32.4"
2829
sku_tier = "Standard"
2930
private_cluster_enabled = true
30-
31+
# Use existing Private DNS Zone for the AKS private API server:
32+
# - "System" lets AKS manage it automatically (default)
33+
# - "None" disables creation/association (you must manage DNS yourself)
34+
# - "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Network/privateDnsZones/privatelink.westeurope.azmk8s.io"
35+
# to reuse an existing zone
36+
private_dns_zone_id = "System"
37+
38+
# Networking (VNet/Subnet)
3139
vnet_name = "vnet-quix-private"
3240
vnet_address_space = ["10.240.0.0/16"]
3341
nodes_subnet_name = "Subnet-Nodes"
3442
nodes_subnet_cidr = "10.240.0.0/22"
3543

36-
nat_identity_name = "quix-private-nat-id"
44+
# Network profile
45+
network_profile = {
46+
network_plugin_mode = "overlay"
47+
service_cidr = "172.22.0.0/16"
48+
dns_service_ip = "172.22.0.10"
49+
pod_cidr = "10.144.0.0/16"
50+
}
51+
52+
# NAT (names reserved even if not used with userDefinedRouting)
53+
identity_name = "quix-private-nat-id"
3754
public_ip_name = "quix-private-nat-ip"
3855
nat_gateway_name = "quix-private-nat"
3956
availability_zone = "2"
4057

41-
enable_credentials_fetch = true
58+
# Bastion
59+
create_bastion_subnet = true
60+
enable_bastion = true
61+
bastion_subnet_cidr = "10.240.5.0/27"
62+
bastion_name = "quix-bastion"
63+
bastion_public_ip_name = "quix-bastion-ip"
64+
65+
# Jumpbox
66+
jumpbox_name = "quix-jumpbox"
67+
jumpbox_vm_size = "Standard_B2s"
68+
jumpbox_admin_username = "azureuser"
69+
jumpbox_ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC3Zz+tHUEI7ulzE69GxtLwi9DOvROBG4aI7h3za2FAP6Ya9/GhG2zcBiKOzk3SlKavE3/5NomgGifTC/ica6rTPlpb4U5oky/2phs9AtczVVI2G+yNC43hJzVhWbqKT3qAGGCGEm2+Cpxx7spKEbZAfAcq5GxL3k9kTcpaQEv3hpVvqK3zlCziHyahUv1pxQGuX3b2hqi4idgFX3m0FaqU98DtQu/I9x95jXHrb7Wltp3sbTSKCDxGo3nk4plpzILs/OqTMSPpfxwarCXA1ZtU82hyWO4Szn2U4I+MbuNaO/dso1oNlprqJQgsQ8t+hawCdIHeZ00M/QELdnYldBjo1jM19AT1OwMcB7PP7GRTNv7YsDW10YCvX9XRPab66PIKpe5R4IG/n6TzEwUP2pb4hRJWvnPJzrHK5HEJg7G7baCEyjCtaWkL4M7dBxIGJ3sp9IfjdeztV2Llh+hYmwPefTejprER+Q/qHZTNr1wEW4BV0TQQd+jeqdIL4QkIno3IyM3IBX+uPM/WlSpi2sT+hDqiUcCRu/x21O/bVYz/UbeHIqptRDfGc5rVoAN/zc/kGsGeGuP3auyI6aQxlnU0wMDdyS8rf3SpWagOB2UFNxZSuU2gnYdtz2uWG4vF75Sqr04MFJImHIY4N7gHJrvdarg6YBaDDnmdREcqp3ooAw=="
70+
71+
# Features
72+
oidc_issuer_enabled = true
73+
workload_identity_enabled = true
74+
enable_credentials_fetch = true
75+
76+
# Node pools
4277
node_pools = {
4378
default = {
4479
name = "default"
@@ -56,32 +91,13 @@ module "aks" {
5691
}
5792
}
5893

59-
network_profile = {
60-
network_plugin_mode = "overlay"
61-
service_cidr = "172.22.0.0/16"
62-
dns_service_ip = "172.22.0.10"
63-
pod_cidr = "10.144.0.0/16"
64-
}
65-
66-
enable_bastion = true
67-
bastion_subnet_cidr = "10.240.5.0/27"
68-
bastion_name = "quix-bastion"
69-
bastion_public_ip_name = "quix-bastion-ip"
70-
71-
jumpbox_name = "quix-jumpbox"
72-
jumpbox_vm_size = "Standard_B2s"
73-
jumpbox_admin_username = "azureuser"
74-
jumpbox_ssh_public_key = "ssh-rsa ......"
75-
76-
oidc_issuer_enabled = true
77-
workload_identity_enabled = true
78-
79-
94+
# Tags
8095
tags = {
8196
environment = "demo"
8297
project = "Quix"
8398
}
8499

100+
# Dependencies
85101
depends_on = [azurerm_resource_group.this]
86102
}
87103

examples/public-quix-infr-tiered-storage/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module "aks" {
2727
nodes_subnet_name = "Subnet-Nodes"
2828
nodes_subnet_cidr = "10.240.0.0/22"
2929

30-
nat_identity_name = "quix-public-nat-id"
30+
identity_name = "quix-public-nat-id"
3131
public_ip_name = "quix-public-nat-ip"
3232
nat_gateway_name = "quix-public-nat"
3333
availability_zone = "1"

examples/public-quix-infr/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module "aks" {
2727
nodes_subnet_name = "Subnet-Nodes"
2828
nodes_subnet_cidr = "10.240.0.0/22"
2929

30-
nat_identity_name = "quix-public-nat-id"
30+
identity_name = "quix-public-nat-id"
3131
public_ip_name = "quix-public-nat-ip"
3232
nat_gateway_name = "quix-public-nat"
3333
availability_zone = "1"

0 commit comments

Comments
 (0)