AKS Reference Documentation

This section provides detailed reference information, command-line tool usage, API specifications, and configuration parameters for Azure Kubernetes Service (AKS).

Azure CLI Commands

This section details commonly used Azure CLI commands for managing AKS clusters. For the complete reference, consult the official Azure CLI documentation.

Cluster Management


# Create a new AKS cluster
az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 1 --enable-addons monitoring --generate-ssh-keys

# Get cluster credentials
az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

# List AKS clusters in a subscription
az aks list --output table

# Show details of a specific AKS cluster
az aks show --resource-group myResourceGroup --name myAKSCluster

# Scale the node count of a cluster
az aks scale --resource-group myResourceGroup --name myAKSCluster --node-count 3

# Upgrade a cluster's Kubernetes version
az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version <new-version>

# Delete an AKS cluster
az aks delete --resource-group myResourceGroup --name myAKSCluster
            

Node Pool Management


# Add a new node pool
az aks nodepool add --resource-group myResourceGroup --cluster-name myAKSCluster --name nodepool2 --node-count 3 --mode User

# List node pools in a cluster
az aks nodepool list --resource-group myResourceGroup --cluster-name myAKSCluster --output table

# Scale a specific node pool
az aks nodepool scale --resource-group myResourceGroup --cluster-name myAKSCluster --name nodepool2 --node-count 5

# Delete a node pool
az aks nodepool delete --resource-group myResourceGroup --cluster-name myAKSCluster --name nodepool2
            

Kubernetes API Reference

AKS is built on Kubernetes. For detailed specifications on Kubernetes API objects such as Pods, Deployments, Services, and more, refer to the official Kubernetes API reference documentation.

Understanding the Kubernetes API is crucial for advanced configuration and automation.

Key API Resources

AKS Configuration Parameters

When creating or updating AKS clusters, various parameters can be configured. Here are some of the most significant ones:

Cluster Creation Parameters (`az aks create`)

Parameter Description Type Required
--resource-group Name of the resource group. String Yes
--name Name of the AKS cluster. String Yes
--node-count Number of nodes in the default node pool. Integer No (defaults to 3)
--kubernetes-version Kubernetes version to use for the cluster. String No (defaults to the latest supported stable version)
--enable-addons Comma-separated list of add-ons to enable (e.g., monitoring, http_application_routing). String No
--network-plugin Network plugin to use (e.g., azure, kubenet). String No (defaults to azure)
--network-policy Network policy to use (e.g., azure, calico). String No
--enable-managed-identity Use managed identity for the cluster. Boolean No (defaults to false)
--location Azure region where the cluster will be deployed. String No (defaults to resource group location)

Node Pool Configuration

Node pools can be configured with specific VM sizes, counts, and other properties. See the `az aks nodepool add` command for details.

Networking Options

Common Error Codes & Solutions

Encountering issues is part of managing any complex system. Here are some common error scenarios and potential resolutions:

ImagePullBackOff: This error indicates that Kubernetes was unable to pull the container image specified in the pod definition.
  • Verify the image name and tag are correct.
  • Ensure the container registry is accessible from the AKS nodes.
  • Check for correct authentication credentials if the registry is private.
CrashLoopBackOff: The container starts, crashes, and Kubernetes restarts it repeatedly.
  • Check the container logs using kubectl logs <pod-name>.
  • Ensure the application is configured correctly and not exiting with an error code.
  • Check resource limits (CPU/memory) if the application is crashing due to resource exhaustion.
DnsPolicy / DnsConfig Issues: Problems with DNS resolution within the cluster.
  • Ensure CoreDNS is running correctly.
  • Validate custom DNS configurations if applicable.
  • Check Network Policies that might be blocking DNS traffic.