You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Once you understand the fundamentals of AKS, the next step is configuring your cluster for production use. This lesson covers node pools, autoscaling, upgrades, identity management, and the configuration options that turn a basic cluster into a production-ready platform.
Node pools are groups of virtual machines with the same configuration. AKS supports two types:
System pools run essential Kubernetes components (CoreDNS, metrics-server, tunnelfront). Every cluster must have at least one system pool.
Best practices:
CriticalAddonsOnly=true:NoSchedule taint to prevent application workloads from running on system nodesUser pools run your application workloads. You can create multiple pools with different characteristics:
# Add a GPU node pool for ML workloads
az aks nodepool add \
--resource-group rg-aks \
--cluster-name my-aks-cluster \
--name gpupool \
--node-count 2 \
--node-vm-size Standard_NC6s_v3 \
--labels workload=gpu
# Add a spot node pool for batch processing
az aks nodepool add \
--resource-group rg-aks \
--cluster-name my-aks-cluster \
--name spotpool \
--node-count 0 \
--min-count 0 \
--max-count 10 \
--enable-cluster-autoscaler \
--priority Spot \
--eviction-policy Delete \
--spot-max-price -1 \
--node-vm-size Standard_D4s_v5
Use labels and taints to control which workloads run on which node pools:
# Deployment targeting the GPU pool
spec:
nodeSelector:
workload: gpu
tolerations:
- key: "kubernetes.azure.com/scalesetpriority"
operator: "Equal"
value: "spot"
effect: "NoSchedule"
AKS provides three layers of autoscaling:
Scales the number of pod replicas based on CPU, memory, or custom metrics.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: my-app-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-app
minReplicas: 2
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
Adds or removes nodes from a node pool based on pod scheduling demand.
# Enable cluster autoscaler on a node pool
az aks nodepool update \
--resource-group rg-aks \
--cluster-name my-aks-cluster \
--name userpool \
--enable-cluster-autoscaler \
--min-count 2 \
--max-count 10
When pods cannot be scheduled due to insufficient resources, the cluster autoscaler adds nodes. When nodes are underutilised, it removes them.
KEDA scales based on external events — queue length, database connections, HTTP traffic, cron schedules, and many more.
# Install KEDA add-on
az aks update \
--resource-group rg-aks \
--cluster-name my-aks-cluster \
--enable-keda
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: queue-processor
spec:
scaleTargetRef:
name: queue-worker
minReplicaCount: 0
maxReplicaCount: 50
triggers:
- type: azure-servicebus
metadata:
queueName: orders
messageCount: "5"
AKS supports both automatic and manual Kubernetes version upgrades.
az aks get-upgrades \
--resource-group rg-aks \
--name my-aks-cluster \
--output table
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.