← 返回命令列表

Linux command

az-aks 命令

网络

需要网络或远程资源。

常用示例

Create a Kubernetes cluster

az aks create -g [resource-group] -n [cluster-name] --generate-ssh-keys

Get credentials for kubectl

az aks get-credentials -g [resource-group] -n [cluster-name]

List all clusters in a resource group

az aks list -g [resource-group] -o table

Show cluster details

az aks show -g [resource-group] -n [cluster-name]

Scale a node pool

az aks nodepool scale -g [resource-group] --cluster-name [cluster-name] --name [nodepool1] --node-count [5]

Upgrade a cluster to a newer Kubernetes version

az aks upgrade -g [resource-group] -n [cluster-name] --kubernetes-version [1.28.0]

Stop a running cluster to save costs

az aks stop -g [resource-group] -n [cluster-name]

Start a stopped cluster

az aks start -g [resource-group] -n [cluster-name]

说明

az aks manages Azure Kubernetes Service (AKS) clusters, providing a managed Kubernetes environment that reduces the complexity of cluster deployment and management. AKS handles critical tasks like health monitoring, maintenance, and upgrades. Azure manages the Kubernetes control plane, while you manage and pay only for the agent nodes.

参数

-g, --resource-group _VALUE_
Name of the resource group.
-n, --name _VALUE_
Name of the managed cluster.
--kubernetes-version _VALUE_
Kubernetes version for the cluster.
--node-count _VALUE_
Number of nodes in the default node pool.
--node-vm-size _VALUE_
Size of virtual machines to create as Kubernetes nodes.
--generate-ssh-keys
Generate SSH key files if not present.
--network-plugin _VALUE_
Kubernetes network plugin (azure, kubenet, none).
--admin
Get cluster admin credentials instead of user credentials.
--overwrite-existing
Overwrite any existing cluster entry in kubeconfig.
-o, --output _FORMAT_
Output format (json, jsonc, table, tsv, yaml, yamlc, none).

FAQ

What is the az-aks command used for?

az aks manages Azure Kubernetes Service (AKS) clusters, providing a managed Kubernetes environment that reduces the complexity of cluster deployment and management. AKS handles critical tasks like health monitoring, maintenance, and upgrades. Azure manages the Kubernetes control plane, while you manage and pay only for the agent nodes.

How do I run a basic az-aks example?

Run `az aks create -g [resource-group] -n [cluster-name] --generate-ssh-keys` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -g, --resource-group _VALUE_ do in az-aks?

Name of the resource group.