Skip to content
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
bb966c0
To transfer it to other VM
Jun 9, 2022
c68227a
Working till outboundcheck
Jun 14, 2022
5fba5c1
Working for demo part
Jun 15, 2022
5cf400b
Code for Demo
Jun 20, 2022
046b4ce
Diagnoser First Draft
Jun 21, 2022
00c36d8
Revert "Diagnoser First Draft"
Jun 21, 2022
806e557
Revert "Revert "Diagnoser First Draft""
Jun 21, 2022
fbd4f10
Diagnoser First Draft (Removed Unwanted files)
Jun 21, 2022
a136ae4
Frist Draft Code ( removed extra files)
Jun 21, 2022
a024972
Diagnoser Code Draft - (Removed style issues - Iteration 1)
Jun 21, 2022
7310cfa
Diagnoser Code Draft - (Removed linter issues - Iteration 2)
Jun 21, 2022
0ec86e8
Diagnoser Code Draft - (Removed style issues - Iteration 3)
Jun 21, 2022
a69ca58
Diagnoser Code Draft - (Removed style issues - Iteration 4)
Jun 21, 2022
76697e0
@svagadia Diagnoser Code Draft - (Removed linter issue - Iteration 5)
Jun 22, 2022
cb91e2c
Diagnoser Code Draft - (Removed linter issue - Iteration 6)
Jun 22, 2022
6e7c320
Diagnoser Code Draft ( Code Changes Iteration 1 )
Jun 22, 2022
9b28cb5
First Draft Code ( Changed the current storage location )
Jun 22, 2022
25e07b1
Diagnoser Code Draft ( Changed agents_version_check )
Jun 22, 2022
e6efe35
Diagnoser First Draft - ( Storage Check and Exceptions added )
Jun 26, 2022
6ed328b
Diagnoser First Draft ( Added Event Logs )
Jun 26, 2022
4ee6418
Diagnoser Code ( Updated Filepaths )
Jun 28, 2022
ef010a7
Azure Arc Diagnostic - ( Deleted Unused Folder )
Jun 28, 2022
ae037c6
Azure Arc Diagnostic - ( Added proper exceptions )
Jun 28, 2022
ec1e6da
Added telemetry exceptions and other changes
Jun 29, 2022
9ad541d
Changed directory and added Diagnoser Results
Jun 30, 2022
4fd69b3
Added create_from_yaml Exception
Jun 30, 2022
4700b1a
Removing style issues Iteration 1
Jun 30, 2022
260341b
Removing style issues Iteration 2
Jun 30, 2022
a7123f2
Removed --debug issue
Jul 1, 2022
c6e713d
Edited Exceptions
Jul 1, 2022
4f476ca
Remove style issues iteration1
Jul 4, 2022
2f9d895
Resolved issues.
Jul 6, 2022
9e13c0d
Updated subprocess with Popen
Jul 6, 2022
d6e2904
Removed Static Analysis errors.
Jul 6, 2022
295c0f6
Update msi_cert_check name
Jul 6, 2022
f82180d
Added comments where required
Jul 6, 2022
649d213
Removed Style issue
Jul 6, 2022
6eb6083
Update _params.py
Jul 6, 2022
78ff3d1
Added proxycert condition
Jul 7, 2022
e560116
Working code for final demo.
Jul 8, 2022
912fe12
Added comments wherever required
Jul 10, 2022
01e3970
Removed Style issues
Jul 11, 2022
e0b1f59
Update _troubleshootutils.py
Jul 11, 2022
2491aec
Corrected the errors.
Jul 11, 2022
24f1bf9
Made necessary corrections.
Jul 11, 2022
f4f0ae1
Made corrections
Jul 11, 2022
e6ed83d
Update _troubleshootutils.py
Jul 11, 2022
0c8fa90
Made improvements
Jul 11, 2022
e90e9ab
Made corrections
Jul 11, 2022
04a318b
Update _troubleshootutils.py
Jul 12, 2022
2948119
Updated dns and outbound
Jul 12, 2022
567092e
Updated the filepath
Jul 12, 2022
d32e61a
Update _troubleshootutils.py
Jul 12, 2022
1fb8434
Resolved errors.
Jul 13, 2022
2dc46e1
Resolved errors.
Jul 13, 2022
af4b2c5
Resolved style issues
Jul 13, 2022
b688290
Updated Constants.py
Jul 13, 2022
68f0ec8
Updated print to logger.warning
Jul 13, 2022
e08b762
Updated security_policy_check
Jul 13, 2022
91cd6ed
Update _troubleshootutils.py
Jul 13, 2022
40f3d25
Made the changes
Jul 13, 2022
5b66e25
Removed unused variables
Jul 13, 2022
ab11adc
Update _constants.py
Jul 13, 2022
b6fcfc0
Update _troubleshootutils.py
Jul 13, 2022
3421ee1
Update _troubleshootutils.py
Jul 13, 2022
2080b2d
Updated the Diagnoser comment
Jul 13, 2022
e2d9b64
Updated agent_state
Jul 13, 2022
2ef3dd3
Updated the comments
Jul 14, 2022
3eebb1d
Updated _troubleshootutils.py
Jul 14, 2022
d1f2c34
Update _troubleshootutils.py
Jul 14, 2022
470da05
Update _troubleshootutils.py
Jul 14, 2022
f0ca8cc
Merge branch 'Azure:main' into troubleshoot
svagadia Jul 14, 2022
c2ce76d
Update _troubleshootutils.py
Jul 14, 2022
faf15f9
Updated MCR image
Jul 15, 2022
bcb1232
Removed typos
Jul 15, 2022
4c490c9
Updated folder names
Jul 15, 2022
72b584f
Update _troubleshootutils.py
Jul 15, 2022
a59490c
Updated the Version
Jul 15, 2022
63e6eea
Updated suggestions
Jul 15, 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
55 changes: 55 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
Azure_ChinaCloudName = 'AZURECHINACLOUD'
Azure_DogfoodCloudName = 'AZUREDOGFOOD'
PublicCloud_OriginalName = 'AZURECLOUD'
MSI_Certificate_Secret_Name = 'azure-identity-certificate'
KAP_Certificate_Secret_Name = 'kube-aad-proxy-certificate'
USGovCloud_OriginalName = 'AZUREUSGOVERNMENT'
Dogfood_RMEndpoint = 'https://api-dogfood.resources.windows-int.net/'
Helm_Environment_File_Fault_Type = 'helm-environment-file-error'
Expand Down Expand Up @@ -118,6 +120,58 @@
Get_PublicKey_Info_Fault_Type = 'Error while fetching the PoP publickey information from client proxy'
PoP_Public_Key_Expried_Fault_Type = 'The PoP public key used to generate the at has expired'
Post_AT_To_ClientProxy_Failed_Fault_Type = 'Failed to post access token to client proxy'
Kubectl_Get_Events_Failed_Fault_Type = "Error while doing kubectl get events"
Fetch_Arc_Agent_Logs_Failed_Fault_Type = "Error occured in arc agents logger"
Fetch_Arc_Agents_Events_Logs_Failed_Fault_Type = "Error occured in arc agents events logger"
Fetch_Arc_Deployment_Logs_Failed_Fault_Type = "Error occured in deployments logger"
Agent_State_Check_Fault_Type = "Error occured while performing the agent state check"
Agent_Version_Check_Fault_Type = "Error occured while performing the agent version check"
Diagnoser_Job_Failed_Fault_Type = "Error while executing Diagnoser Job"
Diagnoser_Container_Check_Failed_Fault_Type = "Error occured while performing the diagnoser container checks"
Cluster_DNS_Check_Fault_Type = "Error occured while performing cluster DNS check"
Outbound_Connectivity_Check_Fault_Type = "Error occured while performing outbound connectivity check in the cluster"
MSI_Cert_Check_Fault_Type = "Error occurred while trying to perform MSI ceritificate presence check"
Cluster_Security_Policy_Check_Fault_Type = "Error occured while performing cluster security policy check"
KAP_Cert_Check_Fault_Type = "Error occurred while trying to perform KAP ceritificate presence check"
MSI_Cert_Expiry_Check_Fault_Type = "Error occured while trying to perform the MSI cert expiry check"
Diagnostics_Folder_Creation_Failed_Fault_Type = "Error while trying to create diagnostic logs folder"
Describe_Stuck_Agents_Fault_Type = "Error occured while storing the description of non running agents"
No_Storage_Space_Available_Fault_Type = "No space left on device"
Connected_Cluster_Resource_Fetch_Fault_Type = "Error occured while fetching the Get output of connected cluster"
Diagnoser_Result_Fault_Type = "Error while storing the diagnoser results"
Kubectl_Cluster_Info_Failed_Fault_Type = "Error while doing kubectl cluster-info"
Fetch_Kubectl_Cluster_Info_Fault_Type = "Error occured while fetching cluster-info"
Fetch_Kubectl_Cluster_Info = "kubectl_cluster_info"
Diagnostic_Check_Passed = "Passed"
Diagnostic_Check_Failed = "Failed"
Diagnostic_Check_Incomplete = "Incomplete"
# Name of the checks and operations
Retrieve_Arc_Agents_Event_Logs = "retrieved_arc_agents_event_logs"
Retrieve_Arc_Agents_Logs = "retrieved_arc_agents_logs"
Retrieve_Deployments_Logs = "retrieved_deployments_logs"
Fetch_Connected_Cluster_Resource = "fetch_connected_cluster_resource"
Storing_Diagnoser_Results_Logs = "storing_diagnoser_results_logs"
MSI_Cert_Expiry_Check = "msi_cert_expiry_check"
KAP_Security_Policy_Check = "kap_security_policy_check"
KAP_Cert_Check = "kap_cert_check"
Diagnoser_Check = "diagnoser_check"
MSI_Cert_Check = "msi_cert_check"
Agent_Version_Check = "agent_version_check"
Arc_Agent_State_Check = "arc_agent_state_check"
# Diagnoser files name
Arc_Diagnostic_Logs = "arc_diagnostic_logs"
Agent_State = "Agent_State.txt"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent_states.txt

Arc_Agents_Events = "Arc_Agents_Events.txt"
Diagnoser_Results = "Diagnoser_Results.txt"
Connected_Cluster_Resource = "Connected_cluster_resource.txt"
DNS_Check = "DNS_Check.txt"
K8s_Cluster_Info = "K8s_Cluster_Info.txt"
Outbound_Network_Connectivity_Check = "Outbound_Network_Connectivity_Check.txt"
Events_of_Incomplete_Diagnoser_Job = "Events_of_Incomplete_Diagnoser_Job.txt"

# Diagnostic Results Name
Outbound_Connectivity_Check_Result_String = "Outbound Network Connectivity Result:"
DNS_Check_Result_String = "DNS Result:"
AZ_CLI_ADAL_TO_MSAL_MIGRATE_VERSION = '2.30.0'
CLIENT_PROXY_VERSION = '1.3.019103'
API_SERVER_PORT = 47011
Expand All @@ -133,3 +187,4 @@
CSP_Storage_Url_Mooncake = "https://k8sconnectcsp.blob.core.chinacloudapi.cn"
HELM_STORAGE_URL = "https://k8connecthelm.azureedge.net"
HELM_VERSION = 'v3.6.3'
Download_And_Install_Kubectl_Fault_Type = "Failed to download and install kubectl"
8 changes: 8 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,11 @@
- name: Disable multiple features.
text: az connectedk8s disable-features -n clusterName -g resourceGroupName --features custom-locations azure-rbac
"""

helps['connectedk8s troubleshoot'] = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anraghun to review the help section

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short-summary: Performs diagnostic checks on the arc-enabled kubernetes an Arc enabled Kubernetes cluster.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • name: Executes Performs diagnostic checks on an arc enabled kubernetes Arc enabled Kubernetes cluster

type: command
short-summary: Performs diagnostic checks on the arc-enabled kubernetes cluster.
examples:
- name: Executes diagnostic checks on an arc enabled kubernetes cluster
text: az connectedk8s troubleshoot -n clusterName -g resourceGroupName
"""
6 changes: 6 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,9 @@ def load_arguments(self, _):
c.argument('context_name', options_list=['--kube-context'], help='If specified, overwrite the default context name.')
c.argument('path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), default=os.path.join(os.path.expanduser('~'), '.kube', 'config'), help="Kubernetes configuration file to update. If not provided, updates the file '~/.kube/config'. Use '-' to print YAML to stdout instead.")
c.argument('api_server_port', options_list=['--port'], help='Port used for accessing connected cluster.')

with self.argument_context('connectedk8s troubleshoot') as c:
c.argument('tags', tags_type)
c.argument('cluster_name', options_list=['--name', '-n'], 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.')
Loading