0
0
Azurecloud~5 mins

Why managed Kubernetes matters in Azure - Why It Works

Choose your learning style9 modes available
Introduction
Running Kubernetes on your own means handling many complex tasks like setup, updates, and fixing problems. Managed Kubernetes services take care of these tasks for you, so you can focus on building your apps instead of managing infrastructure.
When you want to deploy containerized apps without spending time on Kubernetes setup and maintenance
When you need automatic updates and security patches for your Kubernetes cluster
When you want to scale your app easily without managing the underlying servers
When you prefer a cloud provider to handle backups and recovery for your Kubernetes environment
When you want integrated monitoring and logging without extra setup
Commands
This command creates a managed Kubernetes cluster in Azure with 2 nodes. Azure handles the control plane and maintenance for you.
Terminal
az aks create --resource-group example-group --name example-cluster --node-count 2 --enable-managed-identity --generate-ssh-keys
Expected OutputExpected
Waiting for AAD role to propagate { "agentPoolProfiles": [ { "count": 2, "maxPods": 110, "name": "nodepool1", "osType": "Linux", "type": "VirtualMachineScaleSets", "vmSize": "Standard_DS2_v2" } ], "fqdn": "example-cluster-12345.hcp.eastus.azmk8s.io", "id": "/subscriptions/xxxx/resourceGroups/example-group/providers/Microsoft.ContainerService/managedClusters/example-cluster", "location": "eastus", "name": "example-cluster", "nodeResourceGroup": "MC_example-group_example-cluster_eastus", "provisioningState": "Succeeded", "resourceGroup": "example-group", "type": "Microsoft.ContainerService/ManagedClusters" }
--node-count - Sets the number of worker nodes in the cluster
--enable-managed-identity - Uses Azure managed identity for secure cluster operations
--generate-ssh-keys - Creates SSH keys automatically for node access
This command downloads the cluster credentials so you can manage the cluster using kubectl.
Terminal
az aks get-credentials --resource-group example-group --name example-cluster
Expected OutputExpected
Merged "example-cluster" as current context in /home/user/.kube/config
--resource-group - Specifies the resource group of the cluster
--name - Specifies the name of the cluster
This command lists the worker nodes in your managed Kubernetes cluster to verify it is running.
Terminal
kubectl get nodes
Expected OutputExpected
NAME STATUS ROLES AGE VERSION aks-nodepool1-12345678-vmss000000 Ready agent 5m v1.26.1
Key Concept

If you remember nothing else from this pattern, remember: managed Kubernetes lets you run containers without worrying about the complex setup and maintenance.

Common Mistakes
Trying to manage Kubernetes control plane yourself instead of using managed service
It adds unnecessary complexity and risk of misconfiguration
Use Azure Kubernetes Service (AKS) to handle control plane and updates automatically
Not downloading cluster credentials before running kubectl commands
kubectl cannot connect to the cluster without credentials
Run 'az aks get-credentials' to configure kubectl access
Summary
Create a managed Kubernetes cluster with 'az aks create' to let Azure handle control plane and maintenance.
Download cluster credentials using 'az aks get-credentials' to manage the cluster with kubectl.
Verify cluster nodes with 'kubectl get nodes' to confirm your managed Kubernetes is running.