Skip to content

[AKS] Add command az aks namespace to support for managed namespace feature#32387

Merged
yanzhudd merged 3 commits intoAzure:devfrom
xmzhao0822:xmzhao/managed-namespace-ga
Nov 6, 2025
Merged

[AKS] Add command az aks namespace to support for managed namespace feature#32387
yanzhudd merged 3 commits intoAzure:devfrom
xmzhao0822:xmzhao/managed-namespace-ga

Conversation

@xmzhao0822
Copy link
Copy Markdown
Contributor

@xmzhao0822 xmzhao0822 commented Nov 5, 2025

Related command
az aks namespace add -g --cluster-name --name
az aks namespace update -g --cluster-name --name
az aks namespace show -g --cluster-name --name
az aks namespace list -g --cluster-name --name
az aks namespace delete -g --cluster-name --name
az aks namespace get-credentials -g --cluster-name --name

Description
GA the feature for AKS managed namespace. Most logic are copied from AKS cli extension.

Testing Guide
This command will create a managed namespace on an AKS cluster

az aks namespace add --resource-group xm-rg --cluster-name xm1105 --name ns1 
--tags foo=bar key1=val1 --labels app=web --annotations owner=alice 
--cpu-request 500m --cpu-limit 800m --memory-request 1Gi --memory-limit 2Gi
--adoption-policy always

This command will update the properties of an existing managed namespace on an AKS cluster
az aks namespace update -g xm-rg --cluster-name xm1105 -n ns1 --cpu-limit 600m --ingress-policy DenyAll

This command will show the details of a managed namespace in managed Kubernetes cluster
az aks namespace show -g xm-rg --cluster-name xmdemo --name ns1

This command will list managed namespaces in managed Kubernetes cluster
az aks namespace list -g xm-rg --cluster-name xmdemo

This command will delete a managed namespace in managed Kubernetes cluster
az aks namespace delete -g xm-rg --cluster-name xmdemo -n ns1

This command will get access credentials for a managed namespace
az aks namespace get-credentials --name ns1 --cluster-name xmdemo --resource-group xm-rg

History Notes

[AKS] az aks namespace add/update/show/list/delete/get-credentials: Add namespace command to support managed namespace feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings November 5, 2025 17:59
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 5, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @xmzhao0822,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 5, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️acs
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd aks namespace sub group aks namespace added

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 5, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 5, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive support for managed namespaces in Azure Kubernetes Service (AKS), enabling users to create, update, list, show, delete, and retrieve credentials for managed namespaces within AKS clusters.

  • Introduces a new managednamespace.py module with core logic for managed namespace operations
  • Adds validation functions for namespace names and resource quotas
  • Implements CLI commands and help documentation for namespace management

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/azure-cli/azure/cli/command_modules/acs/managednamespace.py New module implementing core logic for add/update operations with validation
src/azure-cli/azure/cli/command_modules/acs/custom.py Adds command implementations for namespace CRUD operations and credential retrieval
src/azure-cli/azure/cli/command_modules/acs/commands.py Registers new CLI command group for aks namespace operations
src/azure-cli/azure/cli/command_modules/acs/_validators.py Adds validators for namespace names and resource quota formats
src/azure-cli/azure/cli/command_modules/acs/_params.py Defines parameters and argument configurations for namespace commands
src/azure-cli/azure/cli/command_modules/acs/_help.py Provides help documentation and examples for namespace commands
src/azure-cli/azure/cli/command_modules/acs/_format.py Adds table formatting for namespace list output
src/azure-cli/azure/cli/command_modules/acs/_consts.py Defines constants for namespace policies and network rules
src/azure-cli/azure/cli/command_modules/acs/_client_factory.py Adds client factory for managed namespace operations
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_validators.py Adds unit tests for namespace name and resource quota validators
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managednamespace.py Adds unit tests for namespace add/update validation logic
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py Adds integration test for end-to-end namespace operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
def test_aks_managed_namespace(self, resource_group, resource_group_location):
Copy link
Copy Markdown
Member

@FumingZhang FumingZhang Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queued live test to validate the change, test passed!

@yanzhudd yanzhudd merged commit 6e81b1d into Azure:dev Nov 6, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants