Skip to content

Commit

Permalink
add --ampls-resource-id and --enable-high-log-scale-mode options
Browse files Browse the repository at this point in the history
  • Loading branch information
ganga1980 committed Jun 28, 2024
1 parent 978430e commit ae7e6bb
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 4 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
+++++++

5.0.0b3
++++++++
* Add option `--enable-high-log-scale-mode` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring` .
* Add option `--ampls-resource-id` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring` .

5.0.0b2
++++++++
* Add option `--ephemeral-disk-volume-type` to `az aks create` and `az aks update` for Azure Container Storage operations.
Expand Down
24 changes: 24 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@
- name: --data-collection-settings
type: string
short-summary: Path to JSON file containing data collection settings for Monitoring addon.
- name: --enable-high-log-scale-mode
type: bool
short-summary: Enable High Log Scale Mode for Container Logs.
- name: --ampls-resource-id
type: string
short-summary: Resource ID of Azure Monitor Private Link scope for Monitoring Addon.
- name: --enable-cluster-autoscaler
type: bool
short-summary: Enable cluster autoscaler, default value is false.
Expand Down Expand Up @@ -2292,6 +2298,12 @@
- name: --data-collection-settings
type: string
short-summary: Path to JSON file containing data collection settings for Monitoring addon.
- name: --enable-high-log-scale-mode
type: bool
short-summary: Enable High Log Scale Mode for Container Logs.
- name: --ampls-resource-id
type: string
short-summary: Resource ID of Azure Monitor Private Link scope for Monitoring Addon.
- name: --subnet-name -s
type: string
short-summary: The subnet name for the virtual node to use.
Expand Down Expand Up @@ -2359,6 +2371,12 @@
- name: --data-collection-settings
type: string
short-summary: Path to JSON file containing data collection settings for Monitoring addon.
- name: --enable-high-log-scale-mode
type: bool
short-summary: Enable High Log Scale Mode for Container Logs.
- name: --ampls-resource-id
type: string
short-summary: Resource ID of Azure Monitor Private Link scope for Monitoring Addon.
- name: --subnet-name -s
type: string
short-summary: The subnet name for the virtual node to use.
Expand Down Expand Up @@ -2440,6 +2458,12 @@
- name: --data-collection-settings
type: string
short-summary: Path to JSON file containing data collection settings for Monitoring addon.
- name: --enable-high-log-scale-mode
type: bool
short-summary: Enable High Log Scale Mode for Container Logs.
- name: --ampls-resource-id
type: string
short-summary: Resource ID of Azure Monitor Private Link scope for Monitoring Addon.
- name: --subnet-name -s
type: string
short-summary: The subnet name for the virtual node to use.
Expand Down
8 changes: 8 additions & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ def load_arguments(self, _):
)
c.argument("enable_syslog", arg_type=get_three_state_flag(), is_preview=True)
c.argument("data_collection_settings", is_preview=True)
c.argument("enable_high_log_scale_mode", arg_type=get_three_state_flag(), is_preview=True)
c.argument("ampls_resource_id", is_preview=True)
c.argument("aci_subnet_name")
c.argument("appgw_name", arg_group="Application Gateway")
c.argument("appgw_subnet_cidr", arg_group="Application Gateway")
Expand Down Expand Up @@ -1843,6 +1845,8 @@ def load_arguments(self, _):
)
c.argument("enable_syslog", arg_type=get_three_state_flag(), is_preview=True)
c.argument("data_collection_settings", is_preview=True)
c.argument("enable_high_log_scale_mode", arg_type=get_three_state_flag(), is_preview=True)
c.argument("ampls_resource_id", is_preview=True)
c.argument(
"dns_zone_resource_id",
deprecate_info=c.deprecate(
Expand Down Expand Up @@ -1898,6 +1902,8 @@ def load_arguments(self, _):
)
c.argument("enable_syslog", arg_type=get_three_state_flag(), is_preview=True)
c.argument("data_collection_settings", is_preview=True)
c.argument("enable_high_log_scale_mode", arg_type=get_three_state_flag(), is_preview=True)
c.argument("ampls_resource_id", is_preview=True)
c.argument(
"dns_zone_resource_id",
deprecate_info=c.deprecate(
Expand Down Expand Up @@ -1936,6 +1942,8 @@ def load_arguments(self, _):
)
c.argument("enable_syslog", arg_type=get_three_state_flag(), is_preview=True)
c.argument("data_collection_settings", is_preview=True)
c.argument("enable_high_log_scale_mode", arg_type=get_three_state_flag(), is_preview=True)
c.argument("ampls_resource_id", is_preview=True)
c.argument(
"dns_zone_resource_id",
deprecate_info=c.deprecate(
Expand Down
10 changes: 8 additions & 2 deletions src/aks-preview/azext_aks_preview/addonconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def enable_addons(
dns_zone_resource_ids=None,
enable_msi_auth_for_monitoring=True,
enable_syslog=False,
data_collection_settings=None
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False,
):
instance = client.get(resource_group_name, name)
# this is overwritten by _update_addons(), so the value needs to be recorded here
Expand Down Expand Up @@ -102,6 +104,8 @@ def enable_addons(
dns_zone_resource_ids=dns_zone_resource_ids,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)

if CONST_MONITORING_ADDON_NAME in instance.addon_profiles and instance.addon_profiles[
Expand All @@ -124,7 +128,9 @@ def enable_addons(
create_dcr=True,
create_dcra=True,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)
else:
# monitoring addon will use legacy path
Expand Down
27 changes: 26 additions & 1 deletion src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ def aks_create(
enable_msi_auth_for_monitoring=True,
enable_syslog=False,
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False,
aci_subnet_name=None,
appgw_name=None,
appgw_subnet_cidr=None,
Expand Down Expand Up @@ -2007,6 +2009,8 @@ def aks_addon_enable(
dns_zone_resource_ids=None,
enable_syslog=False,
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False
):
return enable_addons(
cmd,
Expand All @@ -2031,6 +2035,8 @@ def aks_addon_enable(
dns_zone_resource_ids=dns_zone_resource_ids,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)


Expand Down Expand Up @@ -2061,6 +2067,8 @@ def aks_addon_update(
dns_zone_resource_ids=None,
enable_syslog=False,
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False
):
instance = client.get(resource_group_name, name)
addon_profiles = instance.addon_profiles
Expand Down Expand Up @@ -2110,6 +2118,8 @@ def aks_addon_update(
dns_zone_resource_ids=dns_zone_resource_ids,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)


Expand Down Expand Up @@ -2144,6 +2154,8 @@ def aks_disable_addons(cmd, client, resource_group_name, name, addons, no_wait=F
create_dcra=True,
enable_syslog=False,
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False
)
except TypeError:
pass
Expand Down Expand Up @@ -2186,6 +2198,8 @@ def aks_enable_addons(
dns_zone_resource_ids=None,
enable_syslog=False,
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False,
aks_custom_headers=None,
):
headers = get_aks_custom_headers(aks_custom_headers)
Expand Down Expand Up @@ -2223,6 +2237,8 @@ def aks_enable_addons(
dns_zone_resource_ids=dns_zone_resource_ids,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)
if (
CONST_MONITORING_ADDON_NAME in instance.addon_profiles and
Expand Down Expand Up @@ -2253,14 +2269,21 @@ def aks_enable_addons(
create_dcra=True,
enable_syslog=enable_syslog,
data_collection_settings=data_collection_settings,
ampls_resource_id=ampls_resource_id,
enable_high_log_scale_mode=enable_high_log_scale_mode
)
else:
# monitoring addon will use legacy path
if enable_syslog:
raise ArgumentUsageError(
"--enable-syslog can not be used without MSI auth.")
if enable_high_log_scale_mode:
raise ArgumentUsageError(
"--enable-high-log-scale-mode can not be used without MSI auth.")
if data_collection_settings is not None:
raise ArgumentUsageError("--data-collection-settings can not be used without MSI auth.")
if ampls_resource_id is not None:
raise ArgumentUsageError("--ampls-resource-id can not be used without MSI auth.")
ensure_container_insights_for_monitoring(
cmd,
instance.addon_profiles[CONST_MONITORING_ADDON_NAME],
Expand Down Expand Up @@ -2333,7 +2356,9 @@ def _update_addons(cmd, # pylint: disable=too-many-branches,too-many-statements
dns_zone_resource_ids=None,
no_wait=False, # pylint: disable=unused-argument
enable_syslog=False,
data_collection_settings=None):
data_collection_settings=None,
ampls_resource_id=None,
enable_high_log_scale_mode=False):
ManagedClusterAddonProfile = cmd.get_models(
"ManagedClusterAddonProfile",
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from setuptools import setup, find_packages

VERSION = "5.0.0b2"
VERSION = "5.0.0b3"

CLASSIFIERS = [
"Development Status :: 4 - Beta",
Expand Down

0 comments on commit ae7e6bb

Please sign in to comment.