|
1 | 1 | --- |
2 | 2 | title: Troubleshoot Managed Namespaces Errors |
3 | | -description: Learn how to resolve errors that occur when you try to enable Managed Namespaces on AKS. |
| 3 | +description: Learn how to resolve errors that occur when you try to enable managed namespaces on AKS. |
4 | 4 | ms.date: 08/05/2025 |
5 | 5 | ms.reviewer: jackjiang |
6 | 6 | ms.service: azure-kubernetes-service |
7 | 7 | ms.custom: sap:Extensions, references_regions |
8 | 8 | --- |
9 | | -# Troubleshoot Managed Namespace Errors |
| 9 | +# Troubleshoot managed namespace errors |
10 | 10 |
|
11 | | -This article provides guidance on resolving errors when using Managed Namespaces (Preview) on Microsoft Azure Kubernetes Service (AKS). |
| 11 | +This article provides guidance for resolving errors that occur in Microsoft Azure Kubernetes Service (AKS) when you use the `ManagedNamespacePreview` flag. |
12 | 12 |
|
13 | 13 | ## Prerequisites |
14 | 14 |
|
15 | | -Please make sure the following tools are installed and configured: |
| 15 | +The following tools must be installed and configured: |
16 | 16 |
|
17 | 17 | - [Azure CLI](/cli/azure/install-azure-cli) |
18 | 18 | - [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/), the Kubernetes command-line client |
19 | 19 |
|
20 | | -## Issue 1 - I get a `FeatureNotFound` error when I try to registry the managed namespace flag |
21 | | - |
22 | | -If you receive an error like `(FeatureNotFound) The feature '<feature_name>' could not be found.` |
| 20 | +## Error 1: Feature not found |
23 | 21 |
|
24 | | -Please ensure that the command is entered properly and the spelling is correct. |
| 22 | +### Symptom |
25 | 23 |
|
26 | | -You can run az feature register command to register this preview feature. |
| 24 | +When you try to register the `ManagedNamespacePreview` flag, you receive the following error message: |
27 | 25 |
|
28 | | -`az feature register --namespace Microsoft.containerService -n ManagedNamespacePreview` |
| 26 | +*(FeatureNotFound) The feature '<feature_name>' could not be found.* |
29 | 27 |
|
30 | | -## Issue 2 - I get an error when I try to create a managed namespace or I'm unable to create a managed namespace. |
| 28 | +### Resolution |
31 | 29 |
|
32 | | -If you get a `(BadRequest) Managed namespace requires feature flag Microsoft.ContainerService/ManagedNamespacePreview to be registered.` error, that means the feature flag is not yet registered. If you're already ran the command to register the flag, verify the registration status |
| 30 | +Make sure that the command is entered correctly and uses correct spelling. |
| 31 | + |
| 32 | +To register this preview feature, run the `as feature register` command: |
| 33 | + |
| 34 | +`az feature register --namespace Microsoft.containerService -n ManagedNamespacePreview` |
33 | 35 |
|
34 | | -To verify the registration status, use the az feature show command. |
| 36 | +## Error 2 - Can't create a managed namespace |
| 37 | + |
| 38 | +### Symptom |
| 39 | + |
| 40 | +When you try to create a managed namespace, you receive the following error message: |
| 41 | + |
| 42 | +*(BadRequest) Managed namespace requires feature flag Microsoft.ContainerService/ManagedNamespacePreview to be registered.* |
| 43 | + |
| 44 | +### Resolution |
| 45 | + |
| 46 | +This message indicates that the feature flag is not yet registered. If you already ran the command to register the flag, verify the registration status by running the the `az feature show` command: |
35 | 47 |
|
36 | 48 | `az feature show --namespace Microsoft.ContainerService -n ManagedNamespacePreview` |
37 | 49 |
|
38 | | -## Issue 3 - Some namespaces can't be changed/certain names can't be used |
| 50 | +## Error 3: Can't use or change some namespaces |
39 | 51 |
|
40 | | -Users are not allowed to make change on certain namespaces or create a managed namespaces under certain names, as they are utilized by system components/resources. These namespaces are: |
| 52 | +### Symptom |
41 | 53 |
|
42 | | -default, kube-system, kube-node-lease, kube-public, gatekeeper-system, cert-manager, calico-system, tigera-system, app-routing-system,aks-istio-system, istio-system, dapr-system, flux-system, prometheus-system, eraser-system |
| 54 | +You receive the following error message: |
43 | 55 |
|
44 | | -If a user attempts to create a namespace using one of these names, they will receive an error stating `The namespace name cannot be the same as the name of a system namespace.`. |
| 56 | +*The namespace name cannot be the same as the name of a system namespace.* |
45 | 57 |
|
46 | | -## Issue 4 - I can't update or delete my namespaces |
| 58 | +### Resolution |
47 | 59 |
|
48 | | -Users are not allowed to create, update, or delete managed namespaces when the managed cluster is not in a running state. This behavior is expected and normal. |
| 60 | +Users are not allowed to change certain namespaces or create managed namespaces that use certain names because the names are used by system components or resources. This list includes the following namespaces: |
49 | 61 |
|
50 | | -## Issue 5 - I can't ______ via `kubectl` |
| 62 | +- default |
| 63 | +- kube-system |
| 64 | +- kube-node-lease |
| 65 | +- kube-public |
| 66 | +- gatekeeper-system |
| 67 | +- cert-manager |
| 68 | +- calico-system |
| 69 | +- tigera-system |
| 70 | +- app-routing-system |
| 71 | +- aks-istio-system |
| 72 | +- istio-system |
| 73 | +- dapr-system |
| 74 | +- flux-system |
| 75 | +- prometheus-system |
| 76 | +- eraser-system |
51 | 77 |
|
52 | | -Since the managed namespace is managed by Microsoft Azure Resource Manager (ARM), changes to its metadata (e.g. labels/annotations) are restricted. Kubectl commands that are not allowed are inclusive of, but not limited to editing or deleting: |
| 78 | +## Error 4 - Can't update or delete managed namespaces |
53 | 79 |
|
54 | | -- A managed namespace via `kubectl edit ns <namespace-name>` or `kubectl delete ns <namespace name>` |
55 | | -- A namespace via `kubectl delete resourcequota defaultresourcequota --namespace <namespace-name>` |
56 | | -- A defaultresourcequota via `kubectl delete resourcequota defaultresourcequota --namespace <namespace-name>` |
57 | | -- A defaultnetworkpolicy via `kubectl delete networkpolicy defaultnetworkpolicy --namespace <namespace-name>` |
| 80 | +### Symptom |
| 81 | + |
| 82 | +You can't create, update, or delete managed namespaces. |
| 83 | + |
| 84 | +### Resolution |
| 85 | + |
| 86 | +This behavior is by design. Users are not allowed to create, update, or delete managed namespaces if the managed cluster is not in a running state. |
| 87 | + |
| 88 | +## Error 5: Can't use some kubectl commands |
| 89 | + |
| 90 | +### Symptom |
| 91 | + |
| 92 | +When you try to modify a managed namespace through kubectl, you receive the following error message: |
| 93 | + |
| 94 | +*Updating resource quota defaultresourcequota is not allowed because it is managed by ARM. Please update this resource quota though ARM api.* |
| 95 | + |
| 96 | +### Resolution |
| 97 | + |
| 98 | +Because a managed namespace is managed by Microsoft Azure Resource Manager (ARM), changes to its metadata (labels and annotations) through kubectl commands are restricted. The affected actions include, but are not limited to, edits and deletions to: |
58 | 99 |
|
59 | | -When attempting any action that modifies a managed namespace via kubectl, users will the error `Updating resource quota defaultresourcequota is not allowed because it is managed by ARM. Please update this resource quota though ARM api.` |
| 100 | +- A managed namespace through `kubectl edit ns <namespace-name>` or `kubectl delete ns <namespace name>` |
| 101 | +- A namespace through `kubectl delete resourcequota defaultresourcequota --namespace <namespace-name>` |
| 102 | +- A defaultresourcequota through `kubectl delete resourcequota defaultresourcequota --namespace <namespace-name>` |
| 103 | +- A defaultnetworkpolicy through `kubectl delete networkpolicy defaultnetworkpolicy --namespace <namespace-name>` |
60 | 104 |
|
61 | | -Modifications must be made through the ARM API to ensure consistency with the managed state. Users can manage their managed namespaces in the Azure portal, or via [CLI commands](/cli/azure/aks/namespace) |
| 105 | +Modifications to namespaces must be made through the ARM API to maintain consistency with the managed state. You can manage your managed namespaces in the Azure portal or through [CLI commands](/cli/azure/aks/namespace). |
62 | 106 |
|
63 | 107 | [!INCLUDE [Third-party disclaimer](../../../includes/third-party-disclaimer.md)] |
64 | 108 |
|
|
0 commit comments