This design deploys a Basic Azure Kubernetes Service (AKS) cluster.
Topology: The AKS cluster is deployed in a Spoke VNet. It is peered to the Hub VNet so that CI/CD agents and Admins can access the private API server (if private) or internal services.
+--------------+ +--------------------------+ +--------------+
| Internet | | HUB VNet | | SPOKE VNet |
| | | (Container Reg) | | |
| | | | | |
+------+-------+ +------------+-------------+ +------+-------+
| | |
v | (Peering) |
+------+-------+ v v
| Load | +------------+-------------+ +------+-------+
| Balancer |<----------| ACR (Docker Images) |---------->| AKS Cluster |
| (Public) | | (Private Endpoint) | | (Nodes) |
+------+-------+ +--------------------------+ +------+-------+
| ^
+-------------------------(Traffic)-------------------------------+
PRIMARY REGION (East US)
+-----------------------------------------------------------------------+
| HUB VNet: vnet-hub (10.0.0.0/16) |
| +-----------------------+ |
| | Azure Container Reg | |
| | (ACR) | |
| +-----------|-----------+ |
| | |
| v (Peering) |
+---------------|-------------------------------------------------------+
|
+---------------|-------------------------------------------------------+
| SPOKE VNet: vnet-aks-spoke (10.1.0.0/16) |
| +---------------------------------------------------------------+ |
| | Subnet: snet-aks-nodes (10.1.1.0/24) | |
| | [VMSS Nodes] | |
| | - Pod A (10.1.1.5) | |
| | - Pod B (10.1.1.6) | |
| +---------------------------------------------------------------+ |
+---------------|-------------------------------------------------------+
|
| (GitOps / Flux)
v
+-----------------------------------------------------------------------+
| SECONDARY REGION (West US) - DR Site |
| |
| +-----------------------+ +-----------------------+ |
| | AKS Cluster (Standby) | | ACR Replica | |
| | (Min Node Count: 1) | | (Geo-Replicated) | |
| +-----------------------+ +-----------------------+ |
+-----------------------------------------------------------------------+
podAntiAffinity.* Maintain a secondary cluster in West US.
* Use GitOps (Flux/ArgoCD) to deploy the *same* manifests to both clusters.
* Use Traffic Manager to route to West US if East US fails.
1. User: Hits Public IP of Load Balancer.
2. LB: Routes to a Node (VM).
3. Kube-Proxy: Routes to the Pod IP (10.1.1.5).
4. Pod: Processes request. Needs image?
5. Pull: Node pulls image from ACR (via Hub Peering).
1. Search: "Virtual networks" -> + Create.
2. Resource Group: Create rg-design22-aks.
3. Name: vnet-aks-spoke.
4. Region: East US.
5. IP Addresses: 10.1.0.0/16.
6. Subnets:
* snet-aks-nodes: 10.1.0.0/22 (1024 IPs - AKS needs space).
7. Create.
1. Go to vnet-aks-spoke -> Peerings -> + Add.
2. Remote VNet: Select vnet-hub.
3. Allow gateway transit: Uncheck (unless Hub has VPN).
4. Add.
1. Search: "Container registries" -> + Create.
2. Resource Group: rg-hub-shared.
3. Registry name: acrsharedcorp[uniqueid].
4. SKU: Standard.
5. Create.
1. Search: "Kubernetes services" -> + Create.
2. Basics:
* Resource Group: rg-design22-aks.
* Cluster preset configuration: Standard ($).
* Kubernetes cluster name: aks-prod.
* Region: East US.
* Availability zones: Zone 1, 2, 3.
* API server availability: 99.5%.
3. Node pools:
* agentpool:
* Node size: Standard_DS2_v2.
* Scale method: Autoscale.
* Node count range: 1 to 3.
4. Networking:
* Network configuration: Azure CNI Node Subnet.
* Virtual network: vnet-aks-spoke.
* Cluster subnet: snet-aks-nodes.
* DNS name prefix: aks-prod-dns.
5. Integrations:
* Container registry: Select acrsharedcorp[uniqueid]. (This grants AcrPull role).
6. Review + create -> Create. (Takes 10-15 mins).
1. Once created, click Connect (Top bar).
2. Open Cloud Shell (Bash).
3. Run the commands shown:
* az account set --subscription ...
* az aks get-credentials --resource-group rg-design22-aks --name aks-prod
4. Run: kubectl get nodes.
* You should see the nodes in Ready state.
5. Run: kubectl run nginx --image=nginx.
6. Run: kubectl get pods -o wide.
* Note the IP address. It should be in 10.1.x.x range (VNet IP).
1. Click Connect -> Open Cloud Shell.
2. kubectl get nodes.
3. kubectl run nginx --image=nginx.
4. kubectl get pods.