Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Telemetry to SSH extension #3

Closed
wants to merge 11 commits into from
Closed
5 changes: 5 additions & 0 deletions src/aks-preview/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Release History
===============
0.5.34
+++++
* Add support for WASM nodepools (`--workload-runtime WasmWasi`) in `az aks create`
and `az aks nodepool add`

0.5.33
+++++
* Add support for new addon commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
]
},
"exclude": {
"compatibility issue": [
"test_aks_nodepool_add_with_ossku"
],
"need additional feature": [
"test_aks_create_enable_encryption",
"test_aks_create_edge_zone",
"test_aks_create_with_auto_upgrade_channel"
"test_aks_create_with_auto_upgrade_channel",
"test_aks_create_with_openservicemesh_addon",
"test_aks_enable_openservicemesh_addon",
"test_aks_disable_openservicemesh_addon"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
]
},
"exclude": {
"compatibility issue": [
"test_aks_nodepool_add_with_ossku",
"test_aks_create_with_ossku"
],
"need additional feature": [
"test_aks_create_with_azurekeyvaultsecretsprovider_addon",
"test_aks_create_addon_with_azurekeyvaultsecretsprovider_with_secret_rotation",
Expand Down Expand Up @@ -33,7 +37,9 @@
"test_aks_enable_monitoring_with_aad_auth_msi",
"test_aks_enable_monitoring_with_aad_auth_uai",
"test_aks_create_and_update_with_managed_nat_gateway_outbound",
"test_aks_create_with_http_proxy_config"
"test_aks_create_with_http_proxy_config",
"test_aks_nodepool_add_with_workload_runtime",
"test_aks_nodepool_add_with_gpu_instance_profile"
]
}
}
9 changes: 9 additions & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,14 @@
CONST_AZURE_KEYVAULT_SECRETS_PROVIDER_ADDON_NAME: '- enable Azure Keyvault Secrets Provider addon (PREVIEW).'
}

CONST_WORKLOAD_RUNTIME_OCI_CONTAINER = "OCIContainer"
CONST_WORKLOAD_RUNTIME_WASM_WASI = "WasmWasi"

CONST_MANAGED_IDENTITY_OPERATOR_ROLE = 'Managed Identity Operator'
CONST_MANAGED_IDENTITY_OPERATOR_ROLE_ID = 'f1a07417-d97a-45cb-824c-7a7467783830'

CONST_GPU_INSTANCE_PROFILE_MIG1_G = "MIG1g"
CONST_GPU_INSTANCE_PROFILE_MIG2_G = "MIG2g"
CONST_GPU_INSTANCE_PROFILE_MIG3_G = "MIG3g"
CONST_GPU_INSTANCE_PROFILE_MIG4_G = "MIG4g"
CONST_GPU_INSTANCE_PROFILE_MIG7_G = "MIG7g"
16 changes: 15 additions & 1 deletion src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@
- name: --disable-local-accounts
type: bool
short-summary: (Preview) If set to true, getting static credential will be disabled for this cluster.
- name: --workload-runtime
type: string
short-summary: Determines the type of workload a node can run. Defaults to OCIContainer.
- name: --gpu-instance-profile
type: string
short-summary: GPU instance profile to partition multi-gpu Nvidia GPUs.
examples:
- name: Create a Kubernetes cluster with an existing SSH public key.
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
Expand Down Expand Up @@ -936,13 +942,21 @@
- name: --enable-ultra-ssd
type: bool
short-summary: Enable UltraSSD on agent node pool.
- name: --workload-runtime
type: string
short-summary: Determines the type of workload a node can run. Defaults to OCIContainer.
- name: --gpu-instance-profile
type: string
short-summary: GPU instance profile to partition multi-gpu Nvidia GPUs.
examples:
- name: Create a nodepool in an existing AKS cluster with ephemeral os enabled.
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --node-osdisk-type Ephemeral --node-osdisk-size 48
- name: Create a nodepool with EncryptionAtHost enabled.
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --enable-encryption-at-host
- name: Create a nodepool cluster with a specific os-sku
- name: Create a nodepool with a specific os-sku
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --os-sku Ubuntu
- name: Create a nodepool which can run wasm workloads.
text: az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --workload-runtime WasmWasi
"""

helps['aks nodepool scale'] = """
Expand Down
11 changes: 10 additions & 1 deletion src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE, \
CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER, \
CONST_OS_DISK_TYPE_MANAGED, CONST_OS_DISK_TYPE_EPHEMERAL, \
CONST_RAPID_UPGRADE_CHANNEL, CONST_STABLE_UPGRADE_CHANNEL, CONST_PATCH_UPGRADE_CHANNEL, CONST_NODE_IMAGE_UPGRADE_CHANNEL, CONST_NONE_UPGRADE_CHANNEL
CONST_RAPID_UPGRADE_CHANNEL, CONST_STABLE_UPGRADE_CHANNEL, CONST_PATCH_UPGRADE_CHANNEL, CONST_NODE_IMAGE_UPGRADE_CHANNEL, CONST_NONE_UPGRADE_CHANNEL, \
CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, CONST_WORKLOAD_RUNTIME_WASM_WASI
from ._consts import CONST_GPU_INSTANCE_PROFILE_MIG1_G, CONST_GPU_INSTANCE_PROFILE_MIG2_G, CONST_GPU_INSTANCE_PROFILE_MIG3_G, CONST_GPU_INSTANCE_PROFILE_MIG4_G, CONST_GPU_INSTANCE_PROFILE_MIG7_G

workload_runtimes = [CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, CONST_WORKLOAD_RUNTIME_WASM_WASI]
gpu_instance_profiles = [CONST_GPU_INSTANCE_PROFILE_MIG1_G, CONST_GPU_INSTANCE_PROFILE_MIG2_G, CONST_GPU_INSTANCE_PROFILE_MIG3_G, CONST_GPU_INSTANCE_PROFILE_MIG4_G, CONST_GPU_INSTANCE_PROFILE_MIG7_G]


def load_arguments(self, _):
Expand Down Expand Up @@ -140,7 +145,9 @@ def load_arguments(self, _):
c.argument('enable_secret_rotation', action='store_true')
c.argument('assign_kubelet_identity', type=str, validator=validate_assign_kubelet_identity)
c.argument('disable_local_accounts', action='store_true')
c.argument('gpu_instance_profile', arg_type=get_enum_type(gpu_instance_profiles))
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')
c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER)

with self.argument_context('aks update') as c:
c.argument('enable_cluster_autoscaler', options_list=["--enable-cluster-autoscaler", "-e"], action='store_true')
Expand Down Expand Up @@ -233,6 +240,8 @@ def load_arguments(self, _):
c.argument('linux_os_config', type=str)
c.argument('enable_encryption_at_host', options_list=['--enable-encryption-at-host'], action='store_true')
c.argument('enable_ultra_ssd', action='store_true')
c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER)
c.argument('gpu_instance_profile', arg_type=get_enum_type(gpu_instance_profiles))

for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
with self.argument_context(scope) as c:
Expand Down
16 changes: 12 additions & 4 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,8 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to
disable_local_accounts=False,
no_wait=False,
assign_kubelet_identity=None,
workload_runtime=None,
gpu_instance_profile=None,
yes=False):
if not no_ssh_key:
try:
Expand Down Expand Up @@ -868,7 +870,9 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to
enable_encryption_at_host=enable_encryption_at_host,
enable_ultra_ssd=enable_ultra_ssd,
max_pods=int(max_pods) if max_pods else None,
type=vm_set_type
type=vm_set_type,
workload_runtime=workload_runtime,
gpu_instance_profile=gpu_instance_profile
)

if node_osdisk_size:
Expand Down Expand Up @@ -2017,8 +2021,8 @@ def aks_upgrade(cmd, # pylint: disable=unused-argument, too-many-return-state
'If you only want to upgrade the node version please use the "--node-image-only" option only.')

if node_image_only:
msg = "This node image upgrade operation will run across every node pool in the cluster" \
"and might take a while, do you wish to continue?"
msg = "This node image upgrade operation will run across every node pool in the cluster " \
"and might take a while. Do you wish to continue?"
if not yes and not prompt_y_n(msg, default="n"):
return None

Expand Down Expand Up @@ -2375,6 +2379,8 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local
linux_os_config=None,
enable_encryption_at_host=False,
enable_ultra_ssd=False,
workload_runtime=None,
gpu_instance_profile=None,
no_wait=False):
instances = client.list(resource_group_name, cluster_name)
for agentpool_profile in instances:
Expand Down Expand Up @@ -2428,7 +2434,9 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local
upgrade_settings=upgradeSettings,
enable_encryption_at_host=enable_encryption_at_host,
enable_ultra_ssd=enable_ultra_ssd,
mode=mode
mode=mode,
workload_runtime=workload_runtime,
gpu_instance_profile=gpu_instance_profile
)

if priority == CONST_SCALE_SET_PRIORITY_SPOT:
Expand Down
Loading