Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

/src/ip-group/ @necusjz @kairu-ms @jsntcy

/src/connectedk8s/ @akashkeshari @alphaWizard
/src/connectedk8s/ @akashkeshari @sirireddy12

/src/storagesync/ @jsntcy

Expand Down
7 changes: 7 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Release History
===============
1.3.5
++++++

* Added software assurance related changes for AKS HCI
* Added parameter for overriding container log path
* Updated kubernetes package dependency to 24.2.0

1.3.4
++++++

Expand Down
8 changes: 4 additions & 4 deletions src/connectedk8s/azext_connectedk8s/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def cf_connected_cluster(cli_ctx, _):
return cf_connectedk8s(cli_ctx).connected_cluster


def cf_connectedk8s_prev_2022_05_01(cli_ctx, *_):
from azext_connectedk8s.vendored_sdks.preview_2022_05_01 import ConnectedKubernetesClient
def cf_connectedk8s_prev_2022_10_01(cli_ctx, *_):
from azext_connectedk8s.vendored_sdks.preview_2022_10_01 import ConnectedKubernetesClient
return get_mgmt_service_client(cli_ctx, ConnectedKubernetesClient)


def cf_connected_cluster_prev_2022_05_01(cli_ctx, _):
return cf_connectedk8s_prev_2022_05_01(cli_ctx).connected_cluster
def cf_connected_cluster_prev_2022_10_01(cli_ctx, _):
return cf_connectedk8s_prev_2022_10_01(cli_ctx).connected_cluster


def cf_connectedmachine(cli_ctx, subscription_id):
Expand Down
4 changes: 2 additions & 2 deletions src/connectedk8s/azext_connectedk8s/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

# pylint: disable=line-too-long

Distribution_Enum_Values = ["auto", "generic", "openshift", "rancher_rke", "kind", "k3s", "minikube", "gke", "eks", "aks", "aks_management", "aks_workload", "capz", "aks_engine", "tkg"]
Distribution_Enum_Values = ["auto", "generic", "openshift", "rancher_rke", "kind", "k3s", "minikube", "gke", "eks", "aks", "aks_management", "aks_workload", "capz", "aks_engine", "tkg", "canonical", "karbon"]
Infrastructure_Enum_Values = ["auto", "generic", "azure", "aws", "gcp", "azure_stack_hci", "azure_stack_hub", "azure_stack_edge", "vsphere", "windows_server"]
AHB_Enum_Values = ["True", "False", "NotApplicable"]
Feature_Values = ["cluster-connect", "azure-rbac", "custom-locations"]
CRD_FOR_FORCE_DELETE = ["arccertificates.clusterconfig.azure.com", "azureclusteridentityrequests.clusterconfig.azure.com", "azureextensionidentities.clusterconfig.azure.com", "connectedclusters.arc.azure.com", "customlocationsettings.clusterconfig.azure.com", "extensionconfigs.clusterconfig.azure.com", "gitconfigs.clusterconfig.azure.com"]
Custom_Locations_Provider_Namespace = 'Microsoft.ExtendedLocation'
Expand Down Expand Up @@ -57,7 +58,6 @@
Get_HelmRegistery_Path_Fault_Type = 'helm-registry-path-fetch-error'
Pull_HelmChart_Fault_Type = 'helm-chart-pull-error'
Export_HelmChart_Fault_Type = 'helm-chart-export-error'
Get_Kubernetes_Version_Fault_Type = 'kubernetes-get-version-error'
Get_Kubernetes_Distro_Fault_Type = 'kubernetes-get-distribution-error'
Get_Kubernetes_Namespace_Fault_Type = 'kubernetes-get-namespace-error'
Update_Agent_Success = 'Agents for Connected Cluster {} have been updated successfully'
Expand Down
11 changes: 10 additions & 1 deletion src/connectedk8s/azext_connectedk8s/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from argcomplete.completers import FilesCompleter
from azure.cli.core.commands.parameters import get_location_type, get_enum_type, file_type, tags_type, get_three_state_flag
from azure.cli.core.commands.validators import get_default_location_from_resource_group
from azext_connectedk8s._constants import Distribution_Enum_Values, Infrastructure_Enum_Values, Feature_Values
from azext_connectedk8s._constants import Distribution_Enum_Values, Infrastructure_Enum_Values, Feature_Values, AHB_Enum_Values
from knack.arguments import (CLIArgumentType, CaseInsensitiveList)

from._validators import validate_private_link_properties
Expand All @@ -35,14 +35,18 @@ def load_arguments(self, _):
c.argument('no_proxy', options_list=['--proxy-skip-range'], arg_group='Proxy', help='List of URLs/CIDRs for which proxy should not to be used.')
c.argument('proxy_cert', options_list=['--proxy-cert', '--custom-ca-cert'], arg_group='Proxy', type=file_type, completer=FilesCompleter(), help='Path to the certificate file for proxy or custom Certificate Authority')
c.argument('distribution', options_list=['--distribution'], help='The Kubernetes distribution which will be running on this connected cluster.', arg_type=get_enum_type(Distribution_Enum_Values))
c.argument('distribution_version', help='The Kubernetes distribution version of the connected cluster.')
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('azure_hybrid_benefit', help='Flag to enable/disable Azure Hybrid Benefit feature.', arg_type=get_enum_type(AHB_Enum_Values))
Comment thread
akashkeshari marked this conversation as resolved.
Comment thread
akashkeshari marked this conversation as resolved.
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', arg_type=get_three_state_flag(), arg_group='PrivateLink', help='Flag to enable/disable private link support on a connected cluster resource. Allowed values: false, true.', is_preview=True, validator=validate_private_link_properties)
c.argument('private_link_scope_resource_id', pls_arm_id_type)
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.")
c.argument('correlation_id', options_list=['--correlation-id'], help='A guid that is used to internally track the source of cluster onboarding. Please do not modify it unless advised', validator=override_client_request_id_header)
c.argument('container_log_path', help='Override the default container log path to enable fluent-bit logging')
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

with self.argument_context('connectedk8s update') as c:
c.argument('tags', tags_type)
Expand All @@ -52,9 +56,14 @@ def load_arguments(self, _):
c.argument('https_proxy', options_list=['--proxy-https'], arg_group='Proxy', help='Https proxy URL to be used.')
c.argument('http_proxy', options_list=['--proxy-http'], arg_group='Proxy', help='Http proxy URL to be used.')
c.argument('no_proxy', options_list=['--proxy-skip-range'], arg_group='Proxy', help='List of URLs/CIDRs for which proxy should not to be used.')
c.argument('distribution', help='The Kubernetes distribution which will be running on this connected cluster.', arg_type=get_enum_type(Distribution_Enum_Values))
c.argument('distribution_version', help='The Kubernetes distribution version of the connected cluster.')
c.argument('azure_hybrid_benefit', help='Flag to enable/disable Azure Hybrid Benefit feature.', arg_type=get_enum_type(AHB_Enum_Values))
c.argument('proxy_cert', options_list=['--proxy-cert', '--custom-ca-cert'], arg_group='Proxy', type=file_type, completer=FilesCompleter(), help='Path to the certificate file for proxy or custom Certificate Authority')
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('container_log_path', help='Override the default container log path to enable fluent-bit logging')
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_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
5 changes: 4 additions & 1 deletion src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ 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, enable_private_link, onboarding_timeout="600"):
enable_custom_locations, custom_locations_oid, helm_client_location, enable_private_link, onboarding_timeout="600",
container_log_path=None):
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 Down Expand Up @@ -331,6 +332,8 @@ def helm_install_release(chart_path, subscription_id, kubernetes_distro, kuberne
cmd_helm_install.extend(["--set", "global.isCustomCert={}".format(True)])
if https_proxy or http_proxy or no_proxy:
cmd_helm_install.extend(["--set", "global.isProxyEnabled={}".format(True)])
if container_log_path is not None:
cmd_helm_install.extend(["--set", "systemDefaultValues.fluent-bit.containerLogPath={}".format(container_log_path)])
if kube_config:
cmd_helm_install.extend(["--kubeconfig", kube_config])
if kube_context:
Expand Down
8 changes: 4 additions & 4 deletions src/connectedk8s/azext_connectedk8s/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# pylint: disable=line-too-long
from azure.cli.core.commands import CliCommandType
from azext_connectedk8s._client_factory import (cf_connectedk8s, cf_connected_cluster, cf_connectedk8s_prev_2022_05_01, cf_connected_cluster_prev_2022_05_01)
from azext_connectedk8s._client_factory import (cf_connectedk8s, cf_connected_cluster, cf_connectedk8s_prev_2022_10_01, cf_connected_cluster_prev_2022_10_01)
from ._format import connectedk8s_show_table_format
from ._format import connectedk8s_list_table_format

Expand All @@ -17,8 +17,8 @@ def load_command_table(self, _):
client_factory=cf_connectedk8s
)
connectedk8s_sdk_prev = CliCommandType(
operations_tmpl='azext_connectedk8s.vendored_sdks.preview_2022_05_01.operations#ConnectedClusterOperations.{}',
client_factory=cf_connectedk8s_prev_2022_05_01
operations_tmpl='azext_connectedk8s.vendored_sdks.preview_2022_10_01.operations#ConnectedClusterOperations.{}',
client_factory=cf_connectedk8s_prev_2022_10_01
)
with self.command_group('connectedk8s', connectedk8s_sdk, client_factory=cf_connected_cluster) as g:
g.custom_command('connect', 'create_connectedk8s', supports_no_wait=True)
Expand All @@ -32,6 +32,6 @@ def load_command_table(self, _):
g.custom_command('proxy', 'client_side_proxy_wrapper')
g.custom_command('troubleshoot', 'troubleshoot', is_preview=True)

with self.command_group('connectedk8s', connectedk8s_sdk_prev, client_factory=cf_connected_cluster_prev_2022_05_01) as g:
with self.command_group('connectedk8s', connectedk8s_sdk_prev, client_factory=cf_connected_cluster_prev_2022_10_01) as g:
pass
# use this block for using preview sdk client for a command
Loading