Skip to content

Commit 38a82e1

Browse files
atchutbarliBavneet Singhbavneetsingh16vineeth-thummamcnealm13
authored
[connectedk8s] Update Connectedk8s extension CLI to v1.10.12 (Azure#9416)
* add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * fix CI testcases for nodepool image issues (#8) * update python version to 3.13 (#12) * changes to support gateway association/disassociation for api version '2025-08-01-preview' (#17) * [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (#20) * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * Parameterize for airgapped clouds (#5) * Add parameterization for the airgapped clouds * Fix azdev style * MCR path function * azdev, ruff, and mypy --------- Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> * Oras client fix to work with different MCRs (#6) Co-authored-by: mmcneal <[email protected]> * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * Update cluster diagnostics image to 1.29.3 (#7) * Update cluster diagnostics helm chart to 1.29.3 * Fix lint issues --------- Co-authored-by: bgriddaluru <[email protected]> * RBAC deprecation & fix the issue * typo * fix comments * update tests * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * rebase * fix tests * fix version * fix mypy, lint * fix test * fix test * fix test * fix test * fix test * rename test * deprecate flags * rebase * rebase * bump version for release --------- Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: Atchut Kumar Barli <[email protected]> Co-authored-by: mcnealm13 <[email protected]> Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: vithumma <[email protected]> * remove hardcoded public ARM endpoint url for fairfax and mooncake (#24) * Bug Fix for FFX mcr url (#22) * [connectedk8s] update release notes and version (#26) * Add Helm Overrides for AGC (#23) * add agc overrides * update gns endpoint * add indentation * fix linter error * fix ruff formatting * move overrides to it's own method * update method * update ruff formatting * [Azure RBAC] Remove deprecated flags (#16) * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * Parameterize for airgapped clouds (#5) * Add parameterization for the airgapped clouds * Fix azdev style * MCR path function * azdev, ruff, and mypy --------- Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> * Oras client fix to work with different MCRs (#6) Co-authored-by: mmcneal <[email protected]> * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * Update cluster diagnostics image to 1.29.3 (#7) * Update cluster diagnostics helm chart to 1.29.3 * Fix lint issues --------- Co-authored-by: bgriddaluru <[email protected]> * RBAC deprecation & fix the issue * typo * fix comments * update tests * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * rebase * fix tests * fix version * fix mypy, lint * fix test * fix test * fix test * fix test * fix test * rename test * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * fix CI testcases for nodepool image issues (#8) * update python version to 3.13 (#12) * changes to support gateway association/disassociation for api version '2025-08-01-preview' (#17) * [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (#20) * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * Parameterize for airgapped clouds (#5) * Add parameterization for the airgapped clouds * Fix azdev style * MCR path function * azdev, ruff, and mypy --------- Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> * Oras client fix to work with different MCRs (#6) Co-authored-by: mmcneal <[email protected]> * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * Update cluster diagnostics image to 1.29.3 (#7) * Update cluster diagnostics helm chart to 1.29.3 * Fix lint issues --------- Co-authored-by: bgriddaluru <[email protected]> * RBAC deprecation & fix the issue * typo * fix comments * update tests * add pester tests for connectedk8s cli extension * Pass the force delete param to the API call (#4) * forcedelete * format * add code owner * mypy * fix CI testcases for nodepool image issues (#8) * update errors for the config and connectivity issues (#11) * update errors * format * style * update python version to 3.13 (#12) * rebase * fix tests * fix version * fix mypy, lint * fix test * fix test * fix test * fix test * fix test * rename test * deprecate flags * rebase * rebase * bump version for release --------- Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: Atchut Kumar Barli <[email protected]> Co-authored-by: mcnealm13 <[email protected]> Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: vithumma <[email protected]> * remove breaking change announcement for removed flags --------- Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: Atchut Kumar Barli <[email protected]> Co-authored-by: mcnealm13 <[email protected]> Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: vithumma <[email protected]> * update prediag version (#27) * Updating the proxy version constant (#28) * Update relesae notes * dropping 3.9 * dropping testing folder * fixed code review comments * updateversion * Update src/connectedk8s/HISTORY.rst Co-authored-by: Xing Zhou <[email protected]> --------- Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: Bavneet Singh <[email protected]> Co-authored-by: Vineeth Thumma <[email protected]> Co-authored-by: mcnealm13 <[email protected]> Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: bgriddaluru <[email protected]> Co-authored-by: vithumma <[email protected]> Co-authored-by: hapate <[email protected]> Co-authored-by: junw98 <[email protected]> Co-authored-by: gabemousa <[email protected]> Co-authored-by: Xing Zhou <[email protected]>
1 parent 772069a commit 38a82e1

File tree

9 files changed

+72
-32
lines changed

9 files changed

+72
-32
lines changed

src/connectedk8s/HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
33
Release History
44
===============
5+
1.11.0
6+
+++++
7+
* [Breaking Change] Removed deprecated '--app-id' and '--app-secret' RBAC parameters from the extension.
8+
* Update cluster diagnostics image to comply with Pod Security Standards-Restricted level( Updated image version:1.31.2).
9+
* Add endpoint overrides for Azure Government cloud environments
10+
* Update Proxy Image to 1.3.032281
11+
512
1.10.11
613
+++++++
714
* Removed hardcoded public ARM endpoint URL for Government clouds.

src/connectedk8s/azext_connectedk8s/_breaking_change.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/connectedk8s/azext_connectedk8s/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418

419419
# Connect Precheck Diagnoser constants
420420
Cluster_Diagnostic_Checks_Job_Registry_Path = (
421-
"azurearck8s/helmchart/stable/clusterdiagnosticchecks:1.29.3"
421+
"azurearck8s/helmchart/stable/clusterdiagnosticchecks:1.31.2"
422422
)
423423
Cluster_Diagnostic_Checks_Helm_Install_Failed_Fault_Type = (
424424
"Error while installing cluster diagnostic checks helm release"
@@ -476,7 +476,7 @@
476476
)
477477
DNS_Check_Result_String = "DNS Result:"
478478
AZ_CLI_ADAL_TO_MSAL_MIGRATE_VERSION = "2.30.0"
479-
CLIENT_PROXY_VERSION = "1.3.029301"
479+
CLIENT_PROXY_VERSION = "1.3.032281"
480480
CLIENT_PROXY_FOLDER = ".clientproxy"
481481
API_SERVER_PORT = 47011
482482
CLIENT_PROXY_PORT = 47010

src/connectedk8s/azext_connectedk8s/_params.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -440,20 +440,6 @@ def load_arguments(self: Connectedk8sCommandsLoader, _: CLICommand) -> None:
440440
options_list=["--features"],
441441
help="Space-separated list of features you want to enable.",
442442
)
443-
c.argument(
444-
"azrbac_client_id",
445-
options_list=["--app-id"],
446-
arg_group="Azure RBAC",
447-
help="Application ID for enabling Azure RBAC.",
448-
deprecate_info=c.deprecate(hide=True),
449-
)
450-
c.argument(
451-
"azrbac_client_secret",
452-
options_list=["--app-secret"],
453-
arg_group="Azure RBAC",
454-
help="Application secret for enabling Azure RBAC.",
455-
deprecate_info=c.deprecate(hide=True),
456-
)
457443
c.argument(
458444
"azrbac_skip_authz_check",
459445
options_list=["--skip-azure-rbac-list"],

src/connectedk8s/azext_connectedk8s/_utils.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ def helm_install_release(
13151315
]
13161316

13171317
# Special configurations from 2022-09-01 ARM metadata.
1318+
# "dataplaneEndpoints" property does not appear in arm_metadata structure for public and AGC clouds.
13181319
if "dataplaneEndpoints" in arm_metadata:
13191320
if "arcConfigEndpoint" in arm_metadata["dataplaneEndpoints"]:
13201321
notification_endpoint = arm_metadata["dataplaneEndpoints"][
@@ -1364,6 +1365,10 @@ def helm_install_release(
13641365
"'arcConfigEndpoint' doesn't exist under 'dataplaneEndpoints' in the ARM metadata."
13651366
)
13661367

1368+
# Add overrides for AGC Scenario
1369+
if cloud_name.lower() == "ussec" or cloud_name.lower() == "usnat":
1370+
add_agc_endpoint_overrides(location, cloud_name, arm_metadata, cmd_helm_install)
1371+
13671372
# Add helmValues content response from DP
13681373
cmd_helm_install = parse_helm_values(helm_content_values, cmd_helm=cmd_helm_install)
13691374

@@ -1839,3 +1844,51 @@ def helm_update_agent(
18391844
logger.info(str.format(consts.Update_Agent_Success, cluster_name))
18401845
with contextlib.suppress(OSError):
18411846
os.remove(user_values_location)
1847+
1848+
1849+
def add_agc_endpoint_overrides(
1850+
location: str,
1851+
cloud_name: str,
1852+
arm_metadata: dict[str, Any],
1853+
cmd_helm_install: list[str],
1854+
) -> None:
1855+
logger.debug("Adding AGC scenario overrides.")
1856+
1857+
arm_metadata_endpoint_array = (
1858+
arm_metadata["authentication"]["loginEndpoint"].strip("/").split(".")
1859+
)
1860+
if len(arm_metadata_endpoint_array) < 4:
1861+
raise CLIInternalError("Unexpected loginEndpoint format for AGC")
1862+
1863+
cloud_suffix = arm_metadata_endpoint_array[3]
1864+
endpoint_suffix = (
1865+
arm_metadata_endpoint_array[2] + "." + arm_metadata_endpoint_array[3]
1866+
)
1867+
if cloud_name.lower() == "usnat":
1868+
cloud_suffix = (
1869+
arm_metadata_endpoint_array[2]
1870+
+ "."
1871+
+ arm_metadata_endpoint_array[3]
1872+
+ "."
1873+
+ arm_metadata_endpoint_array[4]
1874+
)
1875+
endpoint_suffix = cloud_suffix
1876+
1877+
cmd_helm_install.extend(
1878+
[
1879+
"--set",
1880+
f"global.microsoftArtifactRepository=mcr.microsoft.{cloud_suffix}",
1881+
"--set",
1882+
f"systemDefaultValues.activeDirectoryEndpoint=https://login.microsoftonline.{endpoint_suffix}",
1883+
"--set",
1884+
f"systemDefaultValues.azureArcAgents.config_dp_endpoint_override=https://{location}.dp.kubernetesconfiguration.azure.{endpoint_suffix}",
1885+
"--set",
1886+
f"systemDefaultValues.clusterconnect-agent.notification_dp_endpoint_override=https://guestnotificationservice.azure.{endpoint_suffix}",
1887+
"--set",
1888+
f"systemDefaultValues.clusterconnect-agent.relay_endpoint_suffix_override=.servicebus.cloudapi.{endpoint_suffix}",
1889+
"--set",
1890+
f"systemDefaultValues.clusteridentityoperator.his_endpoint_override=https://gbl.his.arc.azure.{endpoint_suffix}/discovery?location={location}&api-version=1.1-preview",
1891+
"--set",
1892+
f"systemDefaultValues.image.repository=mcr.microsoft.{cloud_suffix}",
1893+
]
1894+
)

src/connectedk8s/azext_connectedk8s/custom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,8 +2975,6 @@ def enable_features(
29752975
features: list[str],
29762976
kube_config: str | None = None,
29772977
kube_context: str | None = None,
2978-
azrbac_client_id: str | None = None,
2979-
azrbac_client_secret: str | None = None,
29802978
azrbac_skip_authz_check: str | None = None,
29812979
skip_ssl_verification: bool = False,
29822980
cl_oid: str | None = None,

src/connectedk8s/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# TODO: Confirm this is the right version number you want and it matches your
1414
# HISTORY.rst entry.
1515

16-
VERSION = "1.10.11"
16+
VERSION = "1.11.0"
1717

1818
# The full list of classifiers is available at
1919
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

src/k8s-extension/azext_k8s_extension/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ def install_helm_client(cmd: CLICommand) -> str:
763763
"Downloading helm client for first time. This can take few minutes..."
764764
)
765765

766-
mcr_url = utils.get_mcr_path(cmd)
766+
mcr_url = utils.get_mcr_path(cmd.cli_ctx.cloud.endpoints.active_directory)
767767

768768
client = oras.client.OrasClient(hostname=mcr_url)
769769
retry_count = 3

src/k8s-extension/azext_k8s_extension/utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,15 @@ def create_folder_diagnosticlogs(folder_name: str, base_folder_name: str) -> tup
361361
)
362362
return "", False
363363

364-
def get_mcr_path(cmd: CLICommand) -> str:
365-
active_directory_array = cmd.cli_ctx.cloud.endpoints.active_directory.split(".")
364+
def get_mcr_path(active_directory_endpoint: str) -> str:
365+
active_directory_array = active_directory_endpoint.split(".")
366366

367-
# default for public, mc, ff clouds
368-
mcr_postfix = active_directory_array[2]
367+
# For US Government and China clouds, use public mcr
368+
if active_directory_endpoint.endswith((".us", ".cn")):
369+
return "mcr.microsoft.com"
370+
371+
# Default MCR postfix
372+
mcr_postfix = "com"
369373
# special cases for USSec, exclude part of suffix
370374
if len(active_directory_array) == 4 and active_directory_array[2] == "microsoft":
371375
mcr_postfix = active_directory_array[3]

0 commit comments

Comments
 (0)