You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using Azure CLI
13
13
14
-
[](https://ms.portal.azure.com/#view/Microsoft_Azure_CloudNative/SubscriptionSelectionPage.ReactView/tutorialKey/CreateAKSDeployment/isLearnMode~/true)
14
+
[](https://go.microsoft.com/fwlink/?linkid=2262758)
15
15
16
16
Azure Kubernetes Service (AKS) is a managed Kubernetes service that lets you quickly deploy and manage clusters. In this quickstart, you learn how to:
17
17
@@ -37,9 +37,8 @@ This quickstart assumes a basic understanding of Kubernetes concepts. For more i
37
37
38
38
Define the following environment variables for use throughout this quickstart:
39
39
40
-
```bash
40
+
```azurecli-interactive
41
41
export RANDOM_ID="$(openssl rand -hex 3)"
42
-
export SSL_EMAIL_ADDRESS="$(az account show --query user.name --output tsv)"
Create an AKS cluster using the [`az aks create`][az-aks-create] command.
76
+
Create an AKS cluster using the [`az aks create`][az-aks-create] command. The following example creates a cluster with one node and enables a system-assigned managed identity.
78
77
79
78
```azurecli-interactive
80
79
az aks create --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --enable-managed-identity --node-count 1 --generate-ssh-keys
@@ -95,7 +94,7 @@ To manage a Kubernetes cluster, use the Kubernetes command-line client, [kubectl
95
94
96
95
1. Verify the connection to your cluster using the [kubectl get][kubectl-get] command. This command returns a list of the cluster nodes.
97
96
98
-
```bash
97
+
```azurecli-interactive
99
98
kubectl get nodes
100
99
```
101
100
@@ -350,7 +349,7 @@ To deploy the application, you use a manifest file to create all the objects req
350
349
351
350
1. Deploy the application using the [`kubectl apply`][kubectl-apply] command and specify the name of your YAML manifest.
352
351
353
-
```bash
352
+
```azurecli-interactive
354
353
kubectl apply -f aks-store-quickstart.yaml
355
354
```
356
355
@@ -360,7 +359,7 @@ You can validate that the application is running by visiting the public IP addre
360
359
361
360
Get the application URL using the following commands:
362
361
363
-
```bash
362
+
```azurecli-interactive
364
363
runtime="5 minute"
365
364
endtime=$(date -ud "$runtime" +%s)
366
365
while [[ $(date -u +%s) -le $endtime ]]
@@ -378,12 +377,12 @@ do
378
377
done
379
378
```
380
379
381
-
```bash
380
+
```azurecli-interactive
382
381
curl $IP_ADDRESS
383
382
```
384
383
385
384
Results:
386
-
385
+
<!-- expected_similarity=0.3 -->
387
386
```JSON
388
387
<!doctype html>
389
388
<html lang="">
@@ -411,16 +410,10 @@ echo "You can now visit your web server at $IP_ADDRESS"
411
410
412
411
## Delete the cluster
413
412
414
-
If you don't plan on going through the [AKS tutorial][aks-tutorial], clean up unnecessary resources to avoid Azure charges.
413
+
If you don't plan on going through the [AKS tutorial][aks-tutorial], clean up unnecessary resources to avoid Azure charges. You can remove the resource group, container service, and all related resources using the [`az group delete`][az-group-delete] command.
415
414
416
-
Remove the resource group, container service, and all related resources using the [`az group delete`][az-group-delete] command.
417
-
418
-
```azurecli-interactive
419
-
az group delete --name $MY_RESOURCE_GROUP_NAME --yes --no-wait
420
-
```
421
-
422
-
> [!NOTE]
423
-
> The AKS cluster was created with a system-assigned managed identity, which is the default identity option used in this quickstart. The platform manages this identity so you don't need to manually remove it.
415
+
> [!NOTE]
416
+
> The AKS cluster was created with a system-assigned managed identity, which is the default identity option used in this quickstart. The platform manages this identity so you don't need to manually remove it.
0 commit comments