Skip to content

Commit

Permalink
AKS: Add changes for resource consumption for Azure Container Storage (
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhoakash committed Mar 15, 2024
1 parent f9013d3 commit e74bf2c
Show file tree
Hide file tree
Showing 11 changed files with 1,455 additions and 648 deletions.
5 changes: 5 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

2.0.0b5
+++++++
* Add support to enable and disable a single type of storagepool using `--enable-azure-container-storage` and `--disable-azure-container-storage` respectively.
* Add support to define the resource allocation to Azure Container Storage applications based on the type of node pools used and storagepools enabled.

2.0.0b4
+++++++
* Add `--enable-vtpm` to `az aks create`, `az aks nodepool add` and `az aks nodepool update`.
Expand Down
21 changes: 18 additions & 3 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
validate_artifact_streaming,
)
from azext_aks_preview.azurecontainerstorage._consts import (
CONST_ACSTOR_ALL,
CONST_STORAGE_POOL_TYPE_AZURE_DISK,
CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK,
CONST_STORAGE_POOL_TYPE_ELASTIC_SAN,
Expand Down Expand Up @@ -316,6 +317,13 @@
CONST_STORAGE_POOL_TYPE_ELASTIC_SAN,
]

disable_storage_pool_types = [
CONST_STORAGE_POOL_TYPE_AZURE_DISK,
CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK,
CONST_STORAGE_POOL_TYPE_ELASTIC_SAN,
CONST_ACSTOR_ALL,
]

storage_pool_skus = [
CONST_STORAGE_POOL_SKU_PREMIUM_LRS,
CONST_STORAGE_POOL_SKU_STANDARD_LRS,
Expand All @@ -331,6 +339,13 @@
CONST_STORAGE_POOL_OPTION_SSD,
]

disable_storage_pool_options = [
CONST_STORAGE_POOL_OPTION_NVME,
CONST_STORAGE_POOL_OPTION_SSD,
CONST_ACSTOR_ALL,
]

# consts for guardrails level
node_provisioning_modes = [
CONST_NODE_PROVISIONING_MODE_MANUAL,
CONST_NODE_PROVISIONING_MODE_AUTO,
Expand Down Expand Up @@ -1194,8 +1209,8 @@ def load_arguments(self, _):
)
c.argument(
"disable_azure_container_storage",
action="store_true",
help="Flag to disable azure container storage",
arg_type=get_enum_type(disable_storage_pool_types),
help="disable azure container storage or any one of the storagepool types",
)
c.argument(
"storage_pool_name",
Expand All @@ -1212,7 +1227,7 @@ def load_arguments(self, _):
)
c.argument(
"storage_pool_option",
arg_type=get_enum_type(storage_pool_options),
arg_type=get_enum_type(disable_storage_pool_options),
help="set ephemeral disk storage pool option for azure container storage",
)
c.argument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

CONST_ACSTOR_ALL = "all"
CONST_ACSTOR_IO_ENGINE_LABEL_KEY = "acstor.azure.com/io-engine"
CONST_ACSTOR_IO_ENGINE_LABEL_VAL = "acstor"
CONST_ACSTOR_K8S_EXTENSION_NAME = "microsoft.azurecontainerstorage"
Expand All @@ -14,7 +15,7 @@
CONST_STORAGE_POOL_DEFAULT_SIZE = "512Gi"
CONST_STORAGE_POOL_NAME_PREFIX = "storagepool-"
CONST_STORAGE_POOL_OPTION_NVME = "NVMe"
CONST_STORAGE_POOL_OPTION_SSD = "SSD"
CONST_STORAGE_POOL_OPTION_SSD = "Temp"
CONST_STORAGE_POOL_SKU_PREMIUM_LRS = "Premium_LRS"
CONST_STORAGE_POOL_SKU_PREMIUM_ZRS = "Premium_ZRS"
CONST_STORAGE_POOL_SKU_PREMIUMV2_LRS = "PremiumV2_LRS"
Expand All @@ -25,5 +26,3 @@
CONST_STORAGE_POOL_TYPE_AZURE_DISK = "azureDisk"
CONST_STORAGE_POOL_TYPE_ELASTIC_SAN = "elasticSan"
CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK = "ephemeralDisk"

RP_REGISTRATION_POLLING_INTERVAL_IN_SEC = 5
Loading

0 comments on commit e74bf2c

Please sign in to comment.