Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit b2da4d4

Browse files
Merge pull request #172 from AzureArcForKubernetes/release-v1.3.3
bump k8s-extension version to 1.3.3
2 parents 5cd3cf6 + 4fd35e8 commit b2da4d4

File tree

10 files changed

+176
-9
lines changed

10 files changed

+176
-9
lines changed

linter_exclusions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,9 @@ iot central user update:
11661166
central_dns_suffix:
11671167
rule_exclusions:
11681168
- no_parameter_defaults_for_update_commands
1169+
iot device-update update:
1170+
rule_exclusions:
1171+
- require_wait_command_if_no_wait
11691172
iot dps enrollment update:
11701173
parameters:
11711174
auth_type_dataplane:

src/aks-preview/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414
* [BREAKING CHANGE] Since the service no longer supports updating source resource id for role binding, so remove --source-resource-id of `aks trustedaccess rolebinding update` command
15+
* change rolebinding create command parameter roles to comma-seperated
16+
* Upgrade kollect command to use Periscope version 0.0.10 supporting enhanced Windows log collection.
1517

1618
0.5.93
1719
++++++

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@
178178

179179
CONST_PERISCOPE_REPO_ORG = "azure"
180180
CONST_PERISCOPE_CONTAINER_REGISTRY = "mcr.microsoft.com"
181-
CONST_PERISCOPE_RELEASE_TAG = "v0.9"
182-
CONST_PERISCOPE_IMAGE_VERSION = "0.0.9"
181+
CONST_PERISCOPE_RELEASE_TAG = "0.0.10"
182+
CONST_PERISCOPE_IMAGE_VERSION = "0.0.10"
183183
CONST_PERISCOPE_NAMESPACE = "aks-periscope"
184184

185185
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC = "Public"

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@
18371837
18381838
examples:
18391839
- name: Create a new trusted access role binding
1840-
text: az aks trustedaccess rolebinding create -g myResourceGroup --cluster-name myCluster -n bindingName -s /subscriptions/0000/resourceGroups/myResourceGroup/providers/Microsoft.Demo/samples --roles Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer
1840+
text: az aks trustedaccess rolebinding create -g myResourceGroup --cluster-name myCluster -n bindingName -s /subscriptions/0000/resourceGroups/myResourceGroup/providers/Microsoft.Demo/samples --roles Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer
18411841
"""
18421842

18431843
helps['aks trustedaccess rolebinding update'] = """

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,11 @@ def load_arguments(self, _):
703703
'--name', '-n'], required=True, help='The role binding name.')
704704

705705
with self.argument_context('aks trustedaccess rolebinding create') as c:
706-
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
706+
c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...')
707707
c.argument('source_resource_id', options_list=['--source-resource-id', '-s'], help='The source resource id of the binding')
708708

709709
with self.argument_context('aks trustedaccess rolebinding update') as c:
710-
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
710+
c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...')
711711

712712

713713
def _get_default_install_location(exe_name):

src/aks-preview/azext_aks_preview/aks_diagnostics.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
import time
1313

1414
from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_subscription_id
15+
from enum import Flag, auto
1516
from knack.log import get_logger
1617
from knack.prompting import prompt_y_n
1718
from knack.util import CLIError
1819
from msrestazure.azure_exceptions import CloudError
20+
from packaging import version
1921
from tabulate import tabulate
2022

21-
from azext_aks_preview._client_factory import get_storage_client
23+
from azext_aks_preview._client_factory import cf_agent_pools, get_storage_client
2224

2325
from azext_aks_preview._consts import (
2426
CONST_CONTAINER_NAME_MAX_LENGTH,
@@ -34,6 +36,11 @@
3436
logger = get_logger(__name__)
3537

3638

39+
class ClusterFeatures(Flag):
40+
NONE = 0
41+
WIN_HPC = auto()
42+
43+
3744
# pylint: disable=line-too-long
3845
def aks_kollect_cmd(cmd, # pylint: disable=too-many-statements,too-many-locals
3946
client,
@@ -137,7 +144,10 @@ def aks_kollect_cmd(cmd, # pylint: disable=too-many-statements,too-many-local
137144
container_name = _generate_container_name(mc.fqdn, mc.private_fqdn)
138145
sas_token = sas_token.strip('?')
139146

140-
kustomize_yaml = _get_kustomize_yaml(storage_account_name, sas_token, container_name, container_logs, kube_objects, node_logs, node_logs_windows)
147+
cluster_features = _get_cluster_features(cmd.cli_ctx, resource_group_name, name)
148+
149+
run_id = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H-%M-%SZ")
150+
kustomize_yaml = _get_kustomize_yaml(storage_account_name, sas_token, container_name, run_id, cluster_features, container_logs, kube_objects, node_logs, node_logs_windows)
141151
kustomize_folder = tempfile.mkdtemp()
142152
kustomize_file_path = os.path.join(kustomize_folder, "kustomization.yaml")
143153
try:
@@ -227,11 +237,20 @@ def aks_kanalyze_cmd(client, resource_group_name: str, name: str) -> None:
227237
def _get_kustomize_yaml(storage_account_name,
228238
sas_token,
229239
container_name,
240+
run_id,
241+
cluster_features,
230242
container_logs=None,
231243
kube_objects=None,
232244
node_logs_linux=None,
233245
node_logs_windows=None):
246+
components = {
247+
'win-hpc': bool(cluster_features & ClusterFeatures.WIN_HPC)
248+
}
249+
250+
component_content = "\n".join(f'- https://github.com/{CONST_PERISCOPE_REPO_ORG}/aks-periscope//deployment/components/{c}?ref={CONST_PERISCOPE_RELEASE_TAG}' for c, enabled in components.items() if enabled)
251+
234252
diag_config_vars = {
253+
'DIAGNOSTIC_RUN_ID': run_id,
235254
'DIAGNOSTIC_CONTAINERLOGS_LIST': container_logs,
236255
'DIAGNOSTIC_KUBEOBJECTS_LIST': kube_objects,
237256
'DIAGNOSTIC_NODELOGS_LIST_LINUX': node_logs_linux,
@@ -247,6 +266,9 @@ def _get_kustomize_yaml(storage_account_name,
247266
resources:
248267
- https://github.com/{CONST_PERISCOPE_REPO_ORG}/aks-periscope//deployment/base?ref={CONST_PERISCOPE_RELEASE_TAG}
249268
269+
components:
270+
{component_content}
271+
250272
namespace: {CONST_PERISCOPE_NAMESPACE}
251273
252274
images:
@@ -313,6 +335,26 @@ def _generate_container_name(fqdn: str, private_fqdn: str) -> str:
313335
return container_name
314336

315337

338+
def _get_cluster_features(cli_ctx, resource_group_name, cluster_name):
339+
agent_pool_client = cf_agent_pools(cli_ctx)
340+
agent_pool_items = agent_pool_client.list(resource_group_name, cluster_name)
341+
agent_pools = list(agent_pool_items)
342+
343+
features = ClusterFeatures.NONE
344+
if _is_windows_hpc_supported(agent_pools):
345+
features |= ClusterFeatures.WIN_HPC
346+
347+
return features
348+
349+
350+
def _is_windows_hpc_supported(agent_pools):
351+
# https://docs.microsoft.com/en-us/rest/api/aks/agent-pools/list?tabs=HTTP#agentpool
352+
# The full (major.minor.patch) version *may* be stored in currentOrchestratorVersion.
353+
# If not, it'll be in orchestratorVersion.
354+
windows_k8s_versions = [p.current_orchestrator_version or p.orchestrator_version for p in agent_pools if p.os_type.casefold() == "Windows".casefold()]
355+
return all([version.parse(v) >= version.parse("1.23.0") for v in windows_k8s_versions])
356+
357+
316358
def _display_diagnostics_report(temp_kubeconfig_path): # pylint: disable=too-many-statements
317359
if not which('kubectl'):
318360
raise CLIError('Can not find kubectl executable in PATH')

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,8 @@ def aks_trustedaccess_role_binding_create(cmd, client, resource_group_name, clus
22252225
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
22262226
operation_group="trusted_access_role_bindings",
22272227
)
2228-
roleBinding = TrustedAccessRoleBinding(source_resource_id=source_resource_id, roles=roles)
2228+
roleList = roles.split(',')
2229+
roleBinding = TrustedAccessRoleBinding(source_resource_id=source_resource_id, roles=roleList)
22292230
return client.create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)
22302231

22312232

src/index.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11713,6 +11713,79 @@
1171311713
"version": "0.16.1"
1171411714
},
1171511715
"sha256Digest": "d6c814af4bdc4020bbb2971f718796fac0e12a4319258e6704d711c2f9adca38"
11716+
},
11717+
{
11718+
"downloadUrl": "https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.17.0/azure_iot-0.17.0-py3-none-any.whl",
11719+
"filename": "azure_iot-0.17.0-py3-none-any.whl",
11720+
"metadata": {
11721+
"azext.minCliCoreVersion": "2.30.0",
11722+
"classifiers": [
11723+
"Development Status :: 4 - Beta",
11724+
"Intended Audience :: Developers",
11725+
"Intended Audience :: System Administrators",
11726+
"Programming Language :: Python",
11727+
"Programming Language :: Python :: 3 :: Only",
11728+
"Programming Language :: Python :: 3",
11729+
"Programming Language :: Python :: 3.7",
11730+
"Programming Language :: Python :: 3.8",
11731+
"Programming Language :: Python :: 3.9",
11732+
"Programming Language :: Python :: 3.10",
11733+
"License :: OSI Approved :: MIT License"
11734+
],
11735+
"extensions": {
11736+
"python.details": {
11737+
"contacts": [
11738+
{
11739+
"email": "[email protected]",
11740+
"name": "Microsoft",
11741+
"role": "author"
11742+
}
11743+
],
11744+
"document_names": {
11745+
"description": "DESCRIPTION.rst"
11746+
},
11747+
"project_urls": {
11748+
"Home": "https://github.com/azure/azure-iot-cli-extension"
11749+
}
11750+
}
11751+
},
11752+
"extras": [
11753+
"uamqp"
11754+
],
11755+
"generator": "bdist_wheel (0.30.0)",
11756+
"license": "MIT",
11757+
"metadata_version": "2.0",
11758+
"name": "azure-iot",
11759+
"requires_python": ">=3.7",
11760+
"run_requires": [
11761+
{
11762+
"requires": [
11763+
"azure-core (<2.0.0,<2.0.0azure-mgmt-core>=1.3.0,>=1.24.0)",
11764+
"azure-iot-device (~=2.11)",
11765+
"jsonschema (~=3.2.0)",
11766+
"msrest (>=0.6.21)",
11767+
"msrestazure (<2.0.0,>=0.6.3)",
11768+
"packaging",
11769+
"tqdm (~=4.62)"
11770+
]
11771+
},
11772+
{
11773+
"extra": "uamqp",
11774+
"requires": [
11775+
"uamqp (~=1.2)"
11776+
]
11777+
},
11778+
{
11779+
"environment": "python_version < \"3.8\"",
11780+
"requires": [
11781+
"importlib-metadata"
11782+
]
11783+
}
11784+
],
11785+
"summary": "The Azure IoT extension for Azure CLI.",
11786+
"version": "0.17.0"
11787+
},
11788+
"sha256Digest": "924d4cf255efe8a8950d968ed474be42b9da790c46381893a1d2892fdf72281e"
1171611789
}
1171711790
],
1171811791
"azurestackhci": [
@@ -25285,6 +25358,48 @@
2528525358
"version": "1.3.1"
2528625359
},
2528725360
"sha256Digest": "c6231d4bf4f05b5e9f169ddc8dd278113b4c8dcedb3506684641f09d1dfb36ce"
25361+
},
25362+
{
25363+
"downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/k8s_extension-1.3.2-py3-none-any.whl",
25364+
"filename": "k8s_extension-1.3.2-py3-none-any.whl",
25365+
"metadata": {
25366+
"azext.minCliCoreVersion": "2.24.0",
25367+
"classifiers": [
25368+
"Development Status :: 4 - Beta",
25369+
"Intended Audience :: Developers",
25370+
"Intended Audience :: System Administrators",
25371+
"Programming Language :: Python",
25372+
"Programming Language :: Python :: 3",
25373+
"Programming Language :: Python :: 3.6",
25374+
"Programming Language :: Python :: 3.7",
25375+
"Programming Language :: Python :: 3.8",
25376+
"License :: OSI Approved :: MIT License"
25377+
],
25378+
"extensions": {
25379+
"python.details": {
25380+
"contacts": [
25381+
{
25382+
"email": "[email protected]",
25383+
"name": "Microsoft Corporation",
25384+
"role": "author"
25385+
}
25386+
],
25387+
"document_names": {
25388+
"description": "DESCRIPTION.rst"
25389+
},
25390+
"project_urls": {
25391+
"Home": "https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-extension"
25392+
}
25393+
}
25394+
},
25395+
"generator": "bdist_wheel (0.30.0)",
25396+
"license": "MIT",
25397+
"metadata_version": "2.0",
25398+
"name": "k8s-extension",
25399+
"summary": "Microsoft Azure Command-Line Tools K8s-extension Extension",
25400+
"version": "1.3.2"
25401+
},
25402+
"sha256Digest": "f081a5501ade1d6aa9eb62b3fb58de78adb614031c6bbd48b1d8c2af0af1197a"
2528825403
}
2528925404
],
2529025405
"k8sconfiguration": [

src/k8s-extension/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.3.3
7+
++++++++++++++++++
8+
* microsoft.azuremonitor.containers: add condition to use different api version for provisioned clusters
9+
610
1.3.2
711
++++++++++++++++++
812
* Create identity for Appliances clusters

src/k8s-extension/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# TODO: Add any additional SDK dependencies here
3434
DEPENDENCIES = []
3535

36-
VERSION = "1.3.2"
36+
VERSION = "1.3.3"
3737

3838
with open("README.rst", "r", encoding="utf-8") as f:
3939
README = f.read()

0 commit comments

Comments
 (0)