Skip to content
Merged
Show file tree
Hide file tree
Changes from 122 commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
68800b6
Added spn and resource group creation in connectedk8s create
Nov 12, 2019
5090698
Vanilla CLI Code for Connected Cluster
Nov 22, 2019
fda117d
saved location data CLI changes after 0.1.2
Mar 11, 2020
e781176
Added the 0.1.2 version CLI code in master
Mar 11, 2020
969a45f
Removed a print statement
Mar 11, 2020
d60bd23
Fixed container status check
Mar 12, 2020
45e2db7
Updated pod status check
Mar 13, 2020
678c2b7
Merge pull request #1 from akashkeshari/akash/agent_monitor_fix
akashkeshari Mar 16, 2020
85aa7d9
Added 2020 version models and operations
Mar 24, 2020
d345685
Updated with key pair generation
Mar 29, 2020
4e90290
review of public private key pair
Apr 1, 2020
836e6fc
updated models with latest changes in swagger
Apr 4, 2020
a1bea49
Update CLI to support SPN less onboarding
Apr 7, 2020
6522421
Removed location data changes
Apr 13, 2020
dec8fab
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
9bd5580
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
854b36f
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
576704d
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
b26a0eb
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
6d445c3
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
9df8269
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
031639b
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
47ca292
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
b237d9c
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
6249ea7
Updated error messages
Apr 21, 2020
5223949
resolved a conflict
Apr 21, 2020
c1ecbf8
updated wrt style checks
Apr 21, 2020
f43ebfb
Added a recorded test
Apr 21, 2020
d237667
Updated forked master with original master
Apr 21, 2020
32c5089
Updated with latest master changes
Apr 21, 2020
a97f36e
Updated imports
Apr 21, 2020
025522c
removed python 2.x from setup.py
Apr 21, 2020
1967b02
Updated format.py
Apr 21, 2020
df87f51
Updated readme file
Apr 22, 2020
b747e92
Updated test file
Apr 22, 2020
9d9c954
updated setup.py
Apr 22, 2020
2db8c30
updated knack version in setup.py
Apr 22, 2020
bd26f72
updated knack version to 0.7.0rc4 in setup.py
Apr 22, 2020
9dbfa0b
Updated test file to pass kubeconfig
Apr 23, 2020
c45a3a6
Updated test file to pass kubeconfig
Apr 23, 2020
f27610a
Added async support for delete
Apr 24, 2020
9852a51
Added helm charts to test data folder
Apr 27, 2020
ddad5b7
Updated helm chart pull method
Apr 27, 2020
6e6cd75
corrected import order
Apr 27, 2020
eb723fb
Ran connectedk8s test
Apr 27, 2020
a5407c1
Updated some print statements
Apr 27, 2020
3b8f930
ran test with helm upgrade --install
Apr 27, 2020
9f72a47
Updated print to warning
Apr 27, 2020
5515568
Updated error message
Apr 27, 2020
fac6740
Updated exceptions to be generic
Apr 28, 2020
e0f5022
Added aks creation in tests
Apr 29, 2020
c9d1071
updated warning statements
Apr 29, 2020
3b78ee8
updated test to create aks cluster with ssh keys
Apr 29, 2020
96a2cbe
added spn calls in recorded tests
Apr 29, 2020
2c7b8b3
Updated api-version in recorded tests
Apr 29, 2020
b9fdd1e
removed mc delete as CI test needs it to be persistant
Apr 29, 2020
cfb21ab
switched to livescenariotest
Apr 29, 2020
005e414
updated params.py
Apr 30, 2020
ba268a1
corrected databricks change
Apr 30, 2020
0ff1943
updated pod monitoring
Apr 30, 2020
d77e433
updated identation
Apr 30, 2020
44f4547
updated print statement to warnings
Apr 30, 2020
3fa9b10
added telemetry code for connect cli
May 6, 2020
5c56299
Added exception telemetry for delete operation
May 12, 2020
4ddea41
Updated fork master with latest master
May 12, 2020
47fc01b
Updated with latest master
May 12, 2020
9239f83
Updated setup.py
May 12, 2020
ccdbff0
Changed default kubernetes distro
May 12, 2020
e6333d7
Distro detect.
pasankav May 12, 2020
1ef6cdd
Updated history
May 13, 2020
c1612c2
removed arm resourceid from telemetry
May 13, 2020
3ed99da
Merge branch 'akash/connect_telemetry' into pavan/distro_detect
pasankav May 14, 2020
8b26810
Add kubernetes distro and identifying it.
pasankav May 14, 2020
fdacc2b
Remove additional line.
pasankav May 15, 2020
3860c00
correct indentation.
pasankav May 15, 2020
b9b4915
Merge branch 'master' into pavan/distro_detect
pasankav May 15, 2020
f8c4e04
correct indentation.
pasankav May 15, 2020
b752e92
correct version number.
pasankav May 15, 2020
9404057
Merge pull request #5 from akashkeshari/pavan/distro_detect
akashkeshari May 18, 2020
669071f
Merge pull request #4 from akashkeshari/akash/connect_telemetry
akashkeshari May 18, 2020
65e69b8
Merge pull request #2 from akashkeshari/location_data
akashkeshari May 18, 2020
13b8795
Merge remote-tracking branch 'upstream/master'
Aug 13, 2020
da4a59b
merged with latest master
Aug 13, 2020
fcbda96
resolved merge conflict with upstream
Sep 6, 2020
6636a4f
Merge remote-tracking branch 'upstream/master' into master
Oct 16, 2020
a1ba684
Merge remote-tracking branch 'upstream/master' into master
Oct 28, 2020
6ea4e8a
Merge remote-tracking branch 'upstream/master' into master
Dec 2, 2020
3dec24b
Merge remote-tracking branch 'upstream/master' into master
Dec 21, 2020
025e0be
Merge remote-tracking branch 'upstream/master' into master
Jan 22, 2021
4375ef9
Merge remote-tracking branch 'upstream/master' into master
Feb 8, 2021
53aeb0e
Merge remote-tracking branch 'upstream/master' into master
Feb 19, 2021
c6490ec
Merge remote-tracking branch 'upstream/master' into master
May 27, 2021
1751193
updated the preview models
Jun 1, 2021
d6209cc
updated PUT operation for private link
Jun 1, 2021
c86190d
added track2 SDK
Jun 12, 2021
d659941
added pvt link properties in update command
Jun 13, 2021
b564979
removed aio folder
Jul 11, 2021
64ecdc1
disable cluster-connect when private link is getting enabled
Jul 25, 2021
b7ce14c
Merge remote-tracking branch 'upstream/main' into master
Jul 27, 2021
4195205
Merge remote-tracking branch 'upstream/main' into master
Jul 29, 2021
348aebc
Merge remote-tracking branch 'upstream/main' into master
Sep 6, 2021
c4b2f86
Merge remote-tracking branch 'upstream/main' into master
Sep 7, 2021
9f39b33
Merge remote-tracking branch 'upstream/main' into master
Sep 16, 2021
c7f4213
Merge remote-tracking branch 'upstream/main' into master
Oct 14, 2021
32e4d66
Merge remote-tracking branch 'upstream/main' into master
Dec 16, 2021
5817336
Merge remote-tracking branch 'upstream/main' into master
Dec 28, 2021
3e125ac
Merge remote-tracking branch 'upstream/main' into master
Jan 15, 2022
22cfe49
resolved merge conflicts
Jan 15, 2022
1bbcb18
few updates
Jan 17, 2022
1222b6d
fixed async operations
Jan 17, 2022
694be91
fixed async operation delete
Jan 18, 2022
b387dc1
Merge remote-tracking branch 'upstream/main' into master
Jan 30, 2022
b93a287
updated history file
Jan 30, 2022
715b357
updated setup.py
Jan 30, 2022
c1aec0c
fixed merge conflicts
Apr 13, 2022
0bc1174
Merge remote-tracking branch 'upstream/main' into akash/connectedk8s_…
Apr 13, 2022
abf7bd7
added shorter param name for pls arm id
Apr 13, 2022
53b0411
added a check in enable features
Apr 16, 2022
bfe92fd
few updates
Apr 19, 2022
775876b
fixed a help statement
Apr 19, 2022
d90c4f3
fixed patch behavior for existing pvt link enabled cc
Apr 21, 2022
c1ee570
updated prompt message
Apr 26, 2022
91396c2
added pvt link test and re-recorded the tests
Apr 28, 2022
87d636d
delete temporary kube config file
akashkeshari Apr 28, 2022
add4409
re-recorded the tests
Apr 28, 2022
466a095
Merge remote-tracking branch 'upstream/main' into akash/connectedk8s_…
Apr 29, 2022
ce7be95
updated --enable-private-link parameter to three state flag
May 5, 2022
e13415c
re-recorded the tests
May 5, 2022
3e95a8c
removed unused import
May 6, 2022
3fa3637
update if condition
May 6, 2022
3ce1c21
updated the SDK to new preview
Jun 7, 2022
05bd983
added preview client for patch of pvt link enabled resource
Jun 7, 2022
5d17db0
re-recorded tests
Jun 7, 2022
596c551
fix based on comment
Jun 8, 2022
ebb3b3a
merged with latest master
Jul 25, 2022
80f8636
added pls location check
Jul 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Release History
===============
1.2.9
++++++

* Added private link support

1.2.8
++++++

Expand Down
2 changes: 2 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
Dogfood_RMEndpoint = 'https://api-dogfood.resources.windows-int.net/'
Helm_Environment_File_Fault_Type = 'helm-environment-file-error'
Invalid_Location_Fault_Type = 'location-validation-error'
Invalid_Argument_Fault_Type = 'argument-validation-error'
Load_Kubeconfig_Fault_Type = 'kubeconfig-load-error'
Read_ConfigMap_Fault_Type = 'configmap-read-error'
Get_ResourceProvider_Fault_Type = 'resource-provider-fetch-error'
Get_ConnectedCluster_Fault_Type = 'connected-cluster-fetch-error'
Create_ConnectedCluster_Fault_Type = 'connected-cluster-create-error'
Update_ConnectedCluster_Fault_Type = 'connected-cluster-update-error'
Delete_ConnectedCluster_Fault_Type = 'connected-cluster-delete-error'
Bad_DeleteRequest_Fault_Type = 'bad-delete-request-error'
Cluster_Already_Onboarded_Fault_Type = 'cluster-already-onboarded-error'
Expand Down
6 changes: 5 additions & 1 deletion src/connectedk8s/azext_connectedk8s/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@
text: az connectedk8s connect -g resourceGroupName -n connectedClusterName --proxy-https https://proxy-url --proxy-http http://proxy-url --proxy-skip-range excludedIP,excludedCIDR,exampleCIDRfollowed,10.0.0.0/24
- name: Onboard a connected kubernetes cluster by specifying the https proxy, http proxy, no proxy with cert settings.
text: az connectedk8s connect -g resourceGroupName -n connectedClusterName --proxy-cert /path/to/crt --proxy-https https://proxy-url --proxy-http http://proxy-url --proxy-skip-range excludedIP,excludedCIDR,exampleCIDRfollowed,10.0.0.0/24
- name: Onboard a connected kubernetes cluster with private link feature enabled by specifying private link parameters.
text: az connectedk8s connect -g resourceGroupName -n connectedClusterName --enable-private-link true --private-link-scope-resource-id pls/resource/arm/id
- name: Onboard a connected kubernetes cluster with custom onboarding timeout.
text: az connectedk8s connect -g resourceGroupName -n connectedClusterName --onboarding-timeout 600

"""

helps['connectedk8s update'] = """
type: command
short-summary: Update properties of the onboarded agents.
short-summary: Update properties of the arc onboarded kubernetes cluster.
examples:
- name: Update proxy values for the agents
text: az connectedk8s update -g resourceGroupName -n connectedClusterName --proxy-cert /path/to/crt --proxy-https https://proxy-url --proxy-http http://proxy-url --proxy-skip-range excludedIP,excludedCIDR,exampleCIDRfollowed,10.0.0.0/24
- name: Disable proxy settings for agents
text: az connectedk8s update -g resourceGroupName -n connectedClusterName --disable-proxy
- name: Disable auto-upgrade of agents
text: az connectedk8s update -g resourceGroupName -n connectedClusterName --auto-upgrade false
- name: Update a connected cluster to enable private link feature by specifying private link parameters.
text: az connectedk8s update -g resourceGroupName -n connectedClusterName --enable-private-link true --private-link-scope-resource-id pls/resource/arm/id
"""

helps['connectedk8s upgrade'] = """
Expand Down
6 changes: 6 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from azext_connectedk8s._constants import Distribution_Enum_Values, Infrastructure_Enum_Values, Feature_Values
from knack.arguments import (CLIArgumentType, CaseInsensitiveList)

from._validators import validate_private_link_properties

features_types = CLIArgumentType(
nargs='+',
Expand All @@ -34,10 +35,13 @@ def load_arguments(self, _):
c.argument('infrastructure', options_list=['--infrastructure'], help='The infrastructure on which the Kubernetes cluster represented by this connected cluster will be running on.', arg_type=get_enum_type(Infrastructure_Enum_Values))
c.argument('disable_auto_upgrade', options_list=['--disable-auto-upgrade'], action='store_true', help='Flag to disable auto upgrade of arc agents.')
c.argument('cl_oid', options_list=['--custom-locations-oid'], help="OID of 'custom-locations' app")
c.argument('enable_private_link', options_list=['--enable-private-link'], arg_group='PrivateLink', help='Flag to enable/disable private link support on a connected cluster resource. Allowed values: false, true.', is_preview=True, arg_type=get_enum_type(["true", "false"]), validator=validate_private_link_properties)
c.argument('private_link_scope_resource_id', options_list=['--private-link-scope-resource-id', '--pls-arm-id'], arg_group='PrivateLink', help='ARM resource id of the private link scope resource to which this connected cluster is associated.', is_preview=True)
c.argument('onboarding_timeout', options_list=['--onboarding-timeout'], arg_group='Timeout', help='Time required (in seconds) for the arc-agent pods to be installed on the kubernetes cluster. Override this value if the hardware/network constraints on your cluster requires more time for installing the arc-agent pods.')
c.argument('no_wait', options_list=['--no-wait'], arg_group='Timeout', help="Do not wait for the long-running operation to finish.")

with self.argument_context('connectedk8s update') as c:
c.argument('tags', tags_type)
c.argument('cluster_name', options_list=['--name', '-n'], id_part='name', help='The name of the connected cluster.')
c.argument('kube_config', options_list=['--kube-config'], help='Path to the kube config file.')
c.argument('kube_context', options_list=['--kube-context'], help='Kubconfig context from current machine.')
Expand All @@ -47,6 +51,8 @@ def load_arguments(self, _):
c.argument('proxy_cert', options_list=['--proxy-cert'], arg_group='Proxy', type=file_type, completer=FilesCompleter(), help='Path to the any additional certificate file (for proxy as well)')
c.argument('disable_proxy', options_list=['--disable-proxy'], arg_group='Proxy', action='store_true', help='Disables proxy settings for agents')
c.argument('auto_upgrade', options_list=['--auto-upgrade'], help='Flag to enable/disable auto upgrade of arc agents. By default, auto upgrade of agents is enabled.', arg_type=get_enum_type(["true", "false"]))
c.argument('enable_private_link', options_list=['--enable-private-link'], arg_group='PrivateLink', help='Flag to enable/disable private link support on a connected cluster resource. Allowed values: false, true.', is_preview=True, arg_type=get_enum_type(["true", "false"]), validator=validate_private_link_properties)
c.argument('private_link_scope_resource_id', options_list=['--private-link-scope-resource-id', '--pls-arm-id'], arg_group='PrivateLink', help='ARM resource id of the private link scope resource to which this connected cluster is associated.', is_preview=True)

with self.argument_context('connectedk8s upgrade') as c:
c.argument('cluster_name', options_list=['--name', '-n'], id_part='name', help='The name of the connected cluster.')
Expand Down
7 changes: 5 additions & 2 deletions src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def delete_arc_agents(release_namespace, kube_config, kube_context, configuratio
def helm_install_release(chart_path, subscription_id, kubernetes_distro, kubernetes_infra, resource_group_name, cluster_name,
location, onboarding_tenant_id, http_proxy, https_proxy, no_proxy, proxy_cert, private_key_pem,
kube_config, kube_context, no_wait, values_file_provided, values_file, cloud_name, disable_auto_upgrade,
enable_custom_locations, custom_locations_oid, helm_client_location, onboarding_timeout="600"):
enable_custom_locations, custom_locations_oid, helm_client_location, enable_private_link, onboarding_timeout="600"):
cmd_helm_install = [helm_client_location, "upgrade", "--install", "azure-arc", chart_path,
"--set", "global.subscriptionId={}".format(subscription_id),
"--set", "global.kubernetesDistro={}".format(kubernetes_distro),
Expand All @@ -307,9 +307,12 @@ def helm_install_release(chart_path, subscription_id, kubernetes_distro, kuberne
"--set", "systemDefaultValues.clusterconnect-agent.enabled=true",
"--output", "json"]
# Add custom-locations related params
if enable_custom_locations:
if enable_custom_locations and (enable_private_link is None or enable_private_link == "false"):
cmd_helm_install.extend(["--set", "systemDefaultValues.customLocations.enabled=true"])
cmd_helm_install.extend(["--set", "systemDefaultValues.customLocations.oid={}".format(custom_locations_oid)])
# Disable cluster connect if private link is enabled
if enable_private_link == "true":
cmd_helm_install.extend(["--set", "systemDefaultValues.clusterconnect-agent.enabled=false"])
# To set some other helm parameters through file
if values_file_provided:
cmd_helm_install.extend(["-f", values_file])
Expand Down
11 changes: 11 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# --------------------------------------------------------------------------------------------


from os import name
from azure.cli.core.azclierror import ArgumentUsageError


def example_name_or_id_validator(cmd, namespace):
# Example of a storage account name or ID validator.
from azure.cli.core.commands.client_factory import get_subscription_id
Expand All @@ -17,3 +21,10 @@ def example_name_or_id_validator(cmd, namespace):
type='storageAccounts',
name=namespace.storage_account
)


def validate_private_link_properties(namespace):
if (not namespace.enable_private_link or namespace.enable_private_link == "false") and namespace.private_link_scope_resource_id:
raise ArgumentUsageError("Conflicting private link parameters received. The parameter '--private-link-scope-resource-id' should not be set if '--enable-private-link' is passed as null or False.")
if namespace.enable_private_link == "true" and not namespace.private_link_scope_resource_id:
raise ArgumentUsageError("The parameter '--private-link-scope-resource-id' was not provided. It is mandatory to pass this parameter for enabling private link on the connected cluster resource.")
2 changes: 1 addition & 1 deletion src/connectedk8s/azext_connectedk8s/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def load_command_table(self, _):
)
with self.command_group('connectedk8s', connectedk8s_sdk, client_factory=cf_connected_cluster) as g:
g.custom_command('connect', 'create_connectedk8s', supports_no_wait=True)
g.custom_command('update', 'update_agents')
g.custom_command('update', 'update_connected_cluster', supports_no_wait=True)
g.custom_command('upgrade', 'upgrade_agents')
g.custom_command('delete', 'delete_connectedk8s', confirmation=True, supports_no_wait=True)
g.custom_command('enable-features', 'enable_features', is_preview=True)
Expand Down
Loading