feat(aks-preview): add cluster FIPS flag#9844
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @ttruongatl, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Hi @ttruongatl Release SuggestionsModule: aks-preview
Notes
|
There was a problem hiding this comment.
Pull request overview
Adds a new preview flag --enable-fips to the aks-preview extension to enable cluster-wide FIPS mode for az aks create and az aks update, including CLI parameter wiring, help text, request shaping in managed cluster decorators, and unit/live-only tests.
Changes:
- Introduces
--enable-fips(preview) foraz aks createandaz aks updateand wires it through params + custom command signatures. - Implements cluster-level FIPS handling in managed cluster create/update decorators, including Kubernetes version gating (1.34+) and node pool enforcement behavior.
- Adds unit tests for context/decorator behavior and live-only scenario tests for create/update.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/HISTORY.rst | Documents the new preview flag and its requirements. |
| src/aks-preview/azext_aks_preview/managed_cluster_decorator.py | Adds context getter/validation and create/update decorator logic to set cluster/nodepool FIPS flags. |
| src/aks-preview/azext_aks_preview/custom.py | Extends aks_create/aks_update signatures to accept enable_fips and pass through raw parameters. |
| src/aks-preview/azext_aks_preview/_params.py | Registers --enable-fips as a preview argument for create/update. |
| src/aks-preview/azext_aks_preview/_help.py | Adds help entries describing cluster-level FIPS behavior and constraints. |
| src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py | Adds unit tests for context + decorator create/update behavior for cluster FIPS. |
| src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py | Adds live-only scenario tests for create/update with cluster-level FIPS. |
ca78858 to
968dc15
Compare
968dc15 to
1aff431
Compare
2e9ba47 to
800ac73
Compare
768c725 to
5f5e829
Compare
| value_obtained_from_cluster_snapshot = None | ||
| # skip dynamic completion if read_only is specified | ||
| if not read_only: | ||
| if not read_only and self.agentpool_context: |
| * Vendor new SDK and bump API version to 2026-03-02-preview. | ||
| * Update the minimum required cli core version to `2.76.0` (actually since `20.0.0b3`). | ||
| * `az aks upgrade`: Add `--k8s-support-plan` and `--tier` flag support to allow cluster support plan and tier configuration during cluster upgrade. | ||
| * `az aks create/update`: Add `--enable-fips` (preview) to enable FIPS mode at the cluster level and `az aks update --disable-fips` to disable it. Requires Kubernetes version 1.34 or later and AFEC registration `Microsoft.ContainerService/EnableFIPSPreview`. |
There was a problem hiding this comment.
move this to section Pending or a new version
| checks=[self.is_empty()], | ||
| ) | ||
|
|
||
| # FIPS mode at the cluster level is gated by EnableFIPSPreview AFEC and requires K8s 1.34+, |
There was a problem hiding this comment.
please show a proof that the test could pass locally or in the live test pipeline
There was a problem hiding this comment.
Verified with the installed az aks CLI in Canary (eastus2euap) using Azure CLI core 2.86.0 and aks-preview. Both live scenarios passed: create returned enableFips=true, agentPoolFips=true, provisioningState=Succeeded; update create/enable/disable completed successfully with final state enableFips=false, agentPoolFips=true, provisioningState=Succeeded. Report:

This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks create
az aks update
General Guidelines
azdev style aks-previewlocally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.Summary
Adds preview
--enable-fipssupport foraz aks createandaz aks update, including Kubernetes version validation, node pool FIPS enforcement, help text, and tests. This intentionally avoids manually bumping the generated AKS SDK/API version;enableFIPSis sent through the existing model extra REST-property path until the SDK is regenerated.Tests
PYTHONPATH=src/aks-preview python -m pytest src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py::AKSPreviewManagedClusterContextTestCase::test_get_enable_fips src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py::AKSPreviewManagedClusterCreateDecoratorTestCase::test_set_up_enable_fips src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py::AKSPreviewManagedClusterUpdateDecoratorTestCase::test_update_enable_fips -qpython -m pytest src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py -q -k 'enable_fips or get_kubernetes_version'PYTHONPATH=src/aks-preview python -m pytest src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py::AzureKubernetesServiceScenarioTest::test_aks_create_with_cluster_fips src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py::AzureKubernetesServiceScenarioTest::test_aks_update_with_cluster_fips -q(live-only tests collected/skipped locally)PYTHONPATH=src/aks-preview python -m compileall -q src/aks-preview/azext_aks_previewgit diff --check