Share via


az aks namespace

Note

This reference is part of the aks-preview extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az aks namespace command. Learn more about extensions.

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Commands to manage namespace in managed Kubernetes cluster.

Commands

Name Description Type Status
az aks namespace add

Add namespace to the managed Kubernetes cluster.

Extension Preview
az aks namespace delete

Delete a managed namespace in managed Kubernetes cluster.

Extension Preview
az aks namespace get-credentials

Get access credentials for a managed namespace.

Extension Preview
az aks namespace list

List managed namespaces in managed Kubernetes cluster.

Extension Preview
az aks namespace show

Show the details of a managed namespace in managed Kubernetes cluster.

Extension Preview
az aks namespace update

Update namespace on the managed Kubernetes cluster.

Extension Preview

az aks namespace add

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add namespace to the managed Kubernetes cluster.

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]

Examples

Create a namespace in an existing AKS cluster.

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

Create a namespace in an existing AKS cluster with labels, annotations and tags

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

Required Parameters

--cluster-name

Name of the managed cluster.

--cpu-limit

CPU limit of the namespace.

--cpu-request

CPU request of the namespace.

--memory-limit

Memory limit of the namespace.

--memory-request

Memory request of the namespace.

--name -n

The managed namespace name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--adoption-policy

Action if Kubernetes namespace with same name already exists. The default value is Never.

Property Value
Accepted values: Always, IfIdentical, Never
--aks-custom-headers

Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.

--annotations

Annotations for the managed namespace.

--delete-policy

Delete options of a namespace. The default value is Keep.

Property Value
Accepted values: Delete, Keep
--egress-policy

Egress policy for the network. The default value is AllowAll.

Property Value
Accepted values: AllowAll, AllowSameNamespace, DenyAll
--ingress-policy

Ingress policy for the network. The default value is AllowSameNamespace.

Property Value
Accepted values: AllowAll, AllowSameNamespace, DenyAll
--labels

Labels for the managed namespace.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--tags

The tags of the managed namespace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az aks namespace delete

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a managed namespace in managed Kubernetes cluster.

az aks namespace delete --cluster-name
                        --name
                        --resource-group
                        [--no-wait]

Required Parameters

--cluster-name

The cluster name.

--name -n

The managed namespace name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az aks namespace get-credentials

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get access credentials for a managed namespace.

az aks namespace get-credentials --cluster-name
                                 --name
                                 --resource-group
                                 [--context]
                                 [--file]
                                 [--overwrite-existing]

Examples

Get access credentials for a managed namespace. (autogenerated)

az aks namespace get-credentials --resource-group MyResourceGroup --cluster-name MyManagedCluster --name ManagedNamespaceName

Required Parameters

--cluster-name

The cluster name.

--name -n

The managed namespace name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--context

If specified, overwrite the default context name.

--file -f

Kubernetes configuration file to update. Use "-" to print YAML to stdout instead.

Property Value
Default value: ~\.kube\config
--overwrite-existing

Overwrite any existing cluster entry with the same name.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Credentials are always in YAML format, so this argument is effectively ignored.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az aks namespace list

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List managed namespaces in managed Kubernetes cluster.

az aks namespace list [--cluster-name]
                      [--resource-group]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--cluster-name

The cluster name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az aks namespace show

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show the details of a managed namespace in managed Kubernetes cluster.

az aks namespace show --cluster-name
                      --name
                      --resource-group

Required Parameters

--cluster-name

The cluster name.

--name -n

The managed namespace name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az aks namespace update

Preview

Command group 'aks namespace' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update namespace on the managed Kubernetes cluster.

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]

Examples

update namespace in an existing AKS cluster.

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

Required Parameters

--cluster-name

Name of the managed cluster.

--name -n

The managed namespace name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--adoption-policy

Action if Kubernetes namespace with same name already exists.

Property Value
Accepted values: Always, IfIdentical, Never
--aks-custom-headers

Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.

--annotations

Annotations for the managed namespace.

--cpu-limit

CPU limit of the namespace.

--cpu-request

CPU request of the namespace.

--delete-policy

Delete options of a namespace.

Property Value
Accepted values: Delete, Keep
--egress-policy

Egress policy rule for the network.

Property Value
Accepted values: AllowAll, AllowSameNamespace, DenyAll
--ingress-policy

Ingress policy rule for the network.

Property Value
Accepted values: AllowAll, AllowSameNamespace, DenyAll
--labels

Labels for the managed namespace.

--memory-limit

Memory limit of the namespace.

--memory-request

Memory request of the namespace.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--tags

The tags of the managed namespace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False