Azure Kubernetes Service (AKS) Documentation
Azure Kubernetes Service (AKS) is a managed Kubernetes service that simplifies deploying, managing, and scaling containerized applications. AKS provides a fully managed Kubernetes control plane, simplifying the complexities of Kubernetes cluster management.
Key Features of AKS
- Managed Control Plane: Microsoft manages the Kubernetes control plane (API server, etcd, scheduler, etc.), including patching, upgrades, and availability.
- Simplified Cluster Creation: Easily create and configure Kubernetes clusters with Azure CLI, Azure Portal, or ARM templates.
- Integrated Identity: Supports Azure Active Directory (Azure AD) integration for robust authentication and authorization.
- Hybrid Cloud Capabilities: Integrate AKS with Azure Arc for managing Kubernetes clusters across on-premises, edge, and multi-cloud environments.
- Scalability and High Availability: Automatically scale your applications and leverage AKS's built-in high availability for the control plane.
- Secure by Design: Features like network policies, private clusters, and integration with Azure Security Center enhance security.
- Cost-Effective: Pay only for the worker nodes you use; the AKS control plane is free.
Getting Started with AKS
1. Prerequisites
Before you begin, ensure you have the following:
- An Azure subscription.
- Azure CLI installed and logged in.
- A resource group in Azure.
2. Creating an AKS Cluster
You can create an AKS cluster using the Azure CLI:
az group create --name myResourceGroup --location eastus
az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 1 --enable-addons monitoring --generate-ssh-keys
3. Connecting to the Cluster
Configure kubectl to connect to your AKS cluster:
az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
4. Deploying an Application
Deploy a sample application to your AKS cluster:
kubectl create deployment my-app --image=mcr.microsoft.com/azuredocs/aks-helloworld:v1
kubectl expose deployment my-app --port=80 --type=LoadBalancer
kubectl get service my-app -o wide
Common AKS Scenarios
Deploying Multi-Container Applications
For applications with multiple microservices, you can define them using Kubernetes Deployment and Service objects.
Use kubectl apply -f your-manifest.yaml to deploy.
Managing Storage
AKS integrates with Azure Managed Disks and Azure Files for persistent storage.
You can define PersistentVolumeClaim and PersistentVolume resources in your Kubernetes manifests.
Networking and Security
AKS supports various networking configurations, including virtual networks (VNets), network policies for granular traffic control, and private clusters for enhanced security.
Monitoring and Logging
AKS integrates with Azure Monitor for container insights, providing metrics, logs, and performance analysis. Enable container insights during cluster creation or afterward to gain visibility into your cluster.