az aks namespace
Note
This reference is part of the aks-preview extension for the Azure CLI (version 2.61.0 or higher). 该扩展将在首次运行 az aks namespace 命令时自动安装。 Learn more about extensions.
此命令组处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
用于管理托管 Kubernetes 群集中的命名空间的命令。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az aks namespace add |
将命名空间添加到托管 Kubernetes 群集。 |
Extension | Preview |
az aks namespace delete |
删除托管 Kubernetes 群集中的托管命名空间。 |
Extension | Preview |
az aks namespace get-credentials |
获取托管命名空间的访问凭据。 |
Extension | Preview |
az aks namespace list |
列出托管 Kubernetes 群集中的托管命名空间。 |
Extension | Preview |
az aks namespace show |
显示托管 Kubernetes 群集中托管命名空间的详细信息。 |
Extension | Preview |
az aks namespace update |
更新托管 Kubernetes 群集上的命名空间。 |
Extension | Preview |
az aks namespace add
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
将命名空间添加到托管 Kubernetes 群集。
az aks namespace add --cluster-name
--cpu-limit
--cpu-request
--memory-limit
--memory-request
--name
--resource-group
[--adoption-policy {Always, IfIdentical, Never}]
[--aks-custom-headers]
[--annotations]
[--delete-policy {Delete, Keep}]
[--egress-policy {AllowAll, AllowSameNamespace, DenyAll}]
[--ingress-policy {AllowAll, AllowSameNamespace, DenyAll}]
[--labels]
[--no-wait]
[--tags]
示例
在现有 AKS 群集中创建命名空间。
az aks namespace add -g MyResourceGroup --cluster-name MyClusterName --name NamespaceName --cpu-request 500m --cpu-limit 800m --memory-request 1Gi --memory-limit 2Gi --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ManagedNamespacePreview
在具有标签、注释和标记的现有 AKS 群集中创建命名空间
az aks namespace add -g MyResourceGroup --cluster-name MyClusterName --name NamespaceName --labels a=b p=q --annotations a=b p=q --tags a=b p=q --cpu-request 500m --cpu-limit 800m --memory-request 1Gi --memory-limit 2Gi --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ManagedNamespacePreview
必需参数
托管群集的名称。
命名空间的 CPU 限制。
命名空间的 CPU 请求。
命名空间的内存限制。
命名空间的内存请求。
托管命名空间名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果已存在同名的 Kubernetes 命名空间,则执行作。 默认值为“从不”。
属性 | 值 |
---|---|
接受的值: | Always, IfIdentical, Never |
发送自定义标头。 指定时,格式应为 Key1=Value1,Key2=Value2。
托管命名空间的注释。
删除命名空间的选项。 默认值为 Keep。
属性 | 值 |
---|---|
接受的值: | Delete, Keep |
网络的出口策略。 默认值为 AllowAll。
属性 | 值 |
---|---|
接受的值: | AllowAll, AllowSameNamespace, DenyAll |
网络的入口策略。 默认值为 AllowSameNamespace。
属性 | 值 |
---|---|
接受的值: | AllowAll, AllowSameNamespace, DenyAll |
托管命名空间的标签。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
托管命名空间的标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az aks namespace delete
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
删除托管 Kubernetes 群集中的托管命名空间。
az aks namespace delete --cluster-name
--name
--resource-group
[--no-wait]
必需参数
群集名称。
托管命名空间名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az aks namespace get-credentials
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
获取托管命名空间的访问凭据。
az aks namespace get-credentials --cluster-name
--name
--resource-group
[--context]
[--file]
[--overwrite-existing]
示例
获取托管命名空间的访问凭据。 (autogenerated)
az aks namespace get-credentials --resource-group MyResourceGroup --cluster-name MyManagedCluster --name ManagedNamespaceName
必需参数
群集名称。
托管命名空间名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果指定,请覆盖默认上下文名称。
要更新的 Kubernetes 配置文件。 改用“-”将 YAML 打印为 stdout。
属性 | 值 |
---|---|
默认值: | ~\.kube\config |
覆盖具有相同名称的任何现有群集条目。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
凭据始终采用 YAML 格式,因此实际上忽略此参数。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az aks namespace list
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
列出托管 Kubernetes 群集中的托管命名空间。
az aks namespace list [--cluster-name]
[--resource-group]
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
群集名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az aks namespace show
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
显示托管 Kubernetes 群集中托管命名空间的详细信息。
az aks namespace show --cluster-name
--name
--resource-group
必需参数
群集名称。
托管命名空间名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az aks namespace update
命令组“aks 命名空间”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
更新托管 Kubernetes 群集上的命名空间。
az aks namespace update --cluster-name
--name
--resource-group
[--adoption-policy {Always, IfIdentical, Never}]
[--aks-custom-headers]
[--annotations]
[--cpu-limit]
[--cpu-request]
[--delete-policy {Delete, Keep}]
[--egress-policy {AllowAll, AllowSameNamespace, DenyAll}]
[--ingress-policy {AllowAll, AllowSameNamespace, DenyAll}]
[--labels]
[--memory-limit]
[--memory-request]
[--no-wait]
[--tags]
示例
更新现有 AKS 群集中的命名空间。
az aks namespace update -g MyResourceGroup --cluster-name MyClusterName --name NamespaceName --labels a=b p=q --annotations a=b p=q --tags a=b p=q --cpu-request 600m --cpu-limit 800m --memory-request 2Gi --memory-limit 3Gi --adoption-policy Always --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ManagedNamespacePreview
必需参数
托管群集的名称。
托管命名空间名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果已存在同名的 Kubernetes 命名空间,则执行作。
属性 | 值 |
---|---|
接受的值: | Always, IfIdentical, Never |
发送自定义标头。 指定时,格式应为 Key1=Value1,Key2=Value2。
托管命名空间的注释。
命名空间的 CPU 限制。
命名空间的 CPU 请求。
删除命名空间的选项。
属性 | 值 |
---|---|
接受的值: | Delete, Keep |
网络的出口策略规则。
属性 | 值 |
---|---|
接受的值: | AllowAll, AllowSameNamespace, DenyAll |
网络的入口策略规则。
属性 | 值 |
---|---|
接受的值: | AllowAll, AllowSameNamespace, DenyAll |
托管命名空间的标签。
命名空间的内存限制。
命名空间的内存请求。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
托管命名空间的标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |