Repository navigation
[AKS] Support configuring SSH for AKS nodepools - #34161
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
CI reports missing parameter help and scenario coverage, and the changes include minor style violations.
Review effort: Balanced
Findings: 6
Open (6)
Add help text for aks create --ssh-access · New Add help text for nodepool add --ssh-access · New Document delayed effect for nodepool update --ssh-access · New Split line exceeding 120-character limit · New Remove trailing whitespace from blank line · New Remove unused CONST_SSH_ACCESS_ENTRAID import · New
What changed in this PR
Adds configurable SSH access modes for AKS cluster and node-pool creation/update.
Changes:
- Adds
--ssh-accessmodes and update confirmation. - Applies SSH settings to agent-pool security profiles.
- Adds decorator tests and history entries.
| File | Description |
|---|---|
HISTORY.rst |
Documents the new options. |
test_managed_cluster_decorator.py |
Tests cluster creation behavior. |
test_agentpool_decorator.py |
Tests node-pool creation and updates. |
managed_cluster_decorator.py |
Applies SSH access during cluster creation. |
custom.py |
Exposes handler parameters. |
agentpool_decorator.py |
Implements node-pool SSH configuration. |
_params.py |
Registers arguments and accepted values. |
_consts.py |
Defines SSH access constants. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| c.argument('enable_secure_boot', action='store_true') | ||
| c.argument('disable_secure_boot', action='store_true') | ||
| # in update scenario, use empty str as default | ||
| c.argument('ssh_access', arg_type=get_enum_type(ssh_accesses), is_preview=True) |
|
|
||
| def test_set_up_ssh_access(self): | ||
| self.common_set_up_ssh_access() | ||
|
|
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Add help text for ssh_access argument in _params.py Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Add parameter help for --ssh-access on aks nodepool add and nodepool update to satisfy the azdev-linter missing_parameter_help check - Remove is_preview=True from --ssh-access on aks create, nodepool add, and nodepool update since the feature is now GA - Wrap the AgentPoolSecurityProfile assignment to stay within the 120-column limit in managed_cluster_decorator.py - Remove trailing whitespace in test_agentpool_decorator.py - Remove unused CONST_SSH_ACCESS_ENTRAID import in test_managed_cluster_decorator.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the advisory warning emitted when --ssh-access is localuser in set_up_ssh_access, along with the now-unused CONST_SSH_ACCESS_LOCALUSER import in agentpool_decorator.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Please fix CI issues |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Close and reopen to re-trigger the CI. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Hi Yong Zhang (@yonzhan) , the CI passed. Could you help review the PR? Thanks! |
|
|
||
| * `az aks create/update`: Preserve the default managed outbound IPv4 count when only the IPv6 count is provided (#33886) | ||
| * `az aks nodepool add/update`: Add `--enable-managed-dranet` to enable Managed DRANET on a node pool. (#34003) | ||
| * `az aks create`: Add `--ssh-access` with `localuser`, `disabled` and `entraid` options to configure SSH access for the node pools. (#34161) |
There was a problem hiding this comment.
There’s no need to manually update the history note for changes in the official azure-cli repository. CI automatically generates it from the PR title or description.
There was a problem hiding this comment.
Removed it, thanks for reviewing!
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
FumingZhang NoriZC could you help revisit the PR? Thanks! |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
|
||
| msg = ( | ||
| f"You're going to update agentpool {agentpool.name} ssh access to '{ssh_access}' " | ||
| "This change will take effect after you upgrade the nodepool. Proceed?" |
There was a problem hiding this comment.
[P2] Warn that updating SSH access can trigger a reimage
This prompt unconditionally says the change takes effect after upgrading the node pool. For Kubernetes 1.37+, changing SSH access can trigger node-pool reimaging as part of this update, rather than waiting for a separate upgrade. A user could therefore approve this expecting a configuration-only change and encounter unexpected node disruption.
Please update both this confirmation and the --ssh-access help to describe the version-dependent behavior and warn that changing SSH access can trigger reimaging.
There was a problem hiding this comment.
good point, updated code, PTAL, thanks!
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
NoriZC could you please help take a look? Thanks! |
|
JaysonTaiMicrosoft could you please help revisit the PR? Thanks! |

Related command
az akssupport configuring SSH setting for node pools.Description
This PR add support for configuring SSH access for AKS node pool.
Testing Guide
History Notes
[AKS]
az aks create: Add--ssh-accesswithlocaluser,disabledandentraidoptions to configure SSH access for the node pools[AKS]
az aks nodepool add/update: Add--ssh-accesswithlocaluser,disabledandentraidoptions to configure SSH access for the node poolThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.