Skip to content

Commit ee5b00e

Browse files
authored
[AKS] add AKS CMK argument in cluster creation (Azure#14688)
1 parent 4560428 commit ee5b00e

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

linter_exclusions.yml

+3
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ aks create:
253253
workspace_resource_id:
254254
rule_exclusions:
255255
- option_length_too_long
256+
node_osdisk_diskencryptionset_id:
257+
rule_exclusions:
258+
- option_length_too_long
256259
aks enable-addons:
257260
parameters:
258261
workspace_resource_id:

src/azure-cli/azure/cli/command_modules/acs/_help.py

+5
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@
356356
- name: --enable-managed-identity
357357
type: bool
358358
short-summary: Using a system assigned managed identity to manage cluster resource group.
359+
- name: --node-osdisk-diskencryptionset-id -d
360+
type: string
361+
short-summary: ResourceId of the disk encryption set to use for enabling encryption at rest on agent node os disk.
359362
examples:
360363
- name: Create a Kubernetes cluster with an existing SSH public key.
361364
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
@@ -387,6 +390,8 @@
387390
text: az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-sku Standard --network-plugin azure --windows-admin-username azure --windows-admin-password 'replacePassword1234$'
388391
- name: Create a kubernetes cluster with managed AAD enabled.
389392
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-aad --aad-admin-group-object-ids <id-1,id-2> --aad-tenant-id <id>
393+
- name: Create a kubernetes cluster with server side encryption using your owned key.
394+
text: az aks create -g MyResourceGroup -n MyManagedCluster --node-osdisk-diskencryptionset-id <disk-encryption-set-resource-id>
390395
"""
391396

392397
helps['aks update'] = """

src/azure-cli/azure/cli/command_modules/acs/_params.py

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def load_arguments(self, _):
210210
c.argument('enable_node_public_ip', action='store_true', is_preview=True)
211211
c.argument('windows_admin_username', options_list=['--windows-admin-username'])
212212
c.argument('windows_admin_password', options_list=['--windows-admin-password'])
213+
c.argument('node_osdisk_diskencryptionset_id', type=str, options_list=['--node-osdisk-diskencryptionset-id', '-d'])
213214

214215
with self.argument_context('aks update') as c:
215216
c.argument('attach_acr', acr_arg_type, validator=validate_acr)

src/azure-cli/azure/cli/command_modules/acs/custom.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
17481748
kubernetes_version='',
17491749
node_vm_size="Standard_DS2_v2",
17501750
node_osdisk_size=0,
1751+
node_osdisk_diskencryptionset_id='',
17511752
node_count=3,
17521753
nodepool_name="nodepool1",
17531754
nodepool_tags=None,
@@ -2007,7 +2008,8 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
20072008
addon_profiles=addon_profiles,
20082009
aad_profile=aad_profile,
20092010
api_server_access_profile=api_server_access_profile,
2010-
identity=identity
2011+
identity=identity,
2012+
disk_encryption_set_id=node_osdisk_diskencryptionset_id
20112013
)
20122014

20132015
if uptime_sla:

0 commit comments

Comments
 (0)