Skip to content

Commit 561240a

Browse files
authored
aks: add encryption-at-host command (Azure#17813)
1 parent 45a7065 commit 561240a

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

linter_exclusions.yml

+6
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ aks create:
259259
node_osdisk_diskencryptionset_id:
260260
rule_exclusions:
261261
- option_length_too_long
262+
enable_encryption_at_host:
263+
rule_exclusions:
264+
- option_length_too_long
262265
aks enable-addons:
263266
parameters:
264267
workspace_resource_id:
@@ -277,6 +280,9 @@ aks nodepool add:
277280
node_public_ip_prefix_id:
278281
rule_exclusions:
279282
- option_length_too_long
283+
enable_encryption_at_host:
284+
rule_exclusions:
285+
- option_length_too_long
280286
aks update:
281287
parameters:
282288
aad_admin_group_object_ids:

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

+10
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@
437437
- name: --enable-sgxquotehelper
438438
type: bool
439439
short-summary: Enable SGX quote helper for confcom addon.
440+
- name: --enable-encryption-at-host
441+
type: bool
442+
short-summary: Enable EncryptionAtHost, default value is false.
440443
examples:
441444
- name: Create a Kubernetes cluster with an existing SSH public key.
442445
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
@@ -474,6 +477,8 @@
474477
text: az aks create -g MyResourceGroup -n MyManagedCluster --node-osdisk-diskencryptionset-id <disk-encryption-set-resource-id>
475478
- name: Create a kubernetes cluster with ephemeral OS enabled.
476479
text: az aks create -g MyResourceGroup -n MyManagedCluster --node-osdisk-type Ephemeral --node-osdisk-size 48
480+
- name: Create a kubernetes cluster with EncryptionAtHost enabled.
481+
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-encryption-at-host
477482
"""
478483

479484
helps['aks update'] = """
@@ -796,9 +801,14 @@
796801
- name: --max-surge
797802
type: string
798803
short-summary: Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%
804+
- name: --enable-encryption-at-host
805+
type: bool
806+
short-summary: Enable EncryptionAtHost, default value is false.
799807
examples:
800808
- name: Create a nodepool in an existing AKS cluster with ephemeral os enabled.
801809
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --node-osdisk-type Ephemeral --node-osdisk-size 48
810+
- name: Create a nodepool with EncryptionAtHost enabled.
811+
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --enable-encryption-at-host
802812
"""
803813

804814
helps['aks nodepool delete'] = """

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

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def load_arguments(self, _):
220220
c.argument('enable_ahub', options_list=['--enable-ahub'])
221221
c.argument('node_osdisk_diskencryptionset_id', type=str, options_list=['--node-osdisk-diskencryptionset-id', '-d'])
222222
c.argument('aci_subnet_name')
223+
c.argument('enable_encryption_at_host', options_list=['--enable-encryption-at-host'], action='store_true')
223224
c.argument('appgw_name', options_list=['--appgw-name'], arg_group='Application Gateway')
224225
c.argument('appgw_subnet_cidr', options_list=['--appgw-subnet-cidr'], arg_group='Application Gateway')
225226
c.argument('appgw_id', options_list=['--appgw-id'], arg_group='Application Gateway')
@@ -326,6 +327,7 @@ def load_arguments(self, _):
326327
c.argument('ppg', type=str, validator=validate_ppg)
327328
c.argument('max_surge', type=str, validator=validate_max_surge)
328329
c.argument('node_os_disk_type', arg_type=get_enum_type([CONST_OS_DISK_TYPE_MANAGED, CONST_OS_DISK_TYPE_EPHEMERAL]))
330+
c.argument('enable_encryption_at_host', options_list=['--enable-encryption-at-host'], action='store_true')
329331

330332
for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
331333
with self.argument_context(scope) as c:

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

+4
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
18991899
appgw_subnet_id=None,
19001900
appgw_watch_namespace=None,
19011901
enable_sgxquotehelper=False,
1902+
enable_encryption_at_host=False,
19021903
no_wait=False,
19031904
yes=False):
19041905
_validate_ssh_key(no_ssh_key, ssh_key_value)
@@ -1930,6 +1931,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
19301931
availability_zones=zones,
19311932
enable_node_public_ip=enable_node_public_ip,
19321933
node_public_ip_prefix_id=node_public_ip_prefix_id,
1934+
enable_encryption_at_host=enable_encryption_at_host,
19331935
max_pods=int(max_pods) if max_pods else None,
19341936
type=vm_set_type,
19351937
mode="System"
@@ -3446,6 +3448,7 @@ def aks_agentpool_add(cmd, client, resource_group_name, cluster_name, nodepool_n
34463448
labels=None,
34473449
max_surge=None,
34483450
mode="User",
3451+
enable_encryption_at_host=False,
34493452
no_wait=False):
34503453
instances = client.list(resource_group_name, cluster_name)
34513454
for agentpool_profile in instances:
@@ -3491,6 +3494,7 @@ def aks_agentpool_add(cmd, client, resource_group_name, cluster_name, nodepool_n
34913494
node_public_ip_prefix_id=node_public_ip_prefix_id,
34923495
node_taints=taints_array,
34933496
upgrade_settings=upgradeSettings,
3497+
enable_encryption_at_host=enable_encryption_at_host,
34943498
mode=mode
34953499
)
34963500

0 commit comments

Comments
 (0)