Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file added diagnosis/Diagnosis.zip
Binary file not shown.
30 changes: 24 additions & 6 deletions diagnosis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,39 @@ This short [guide](https://github.com/Azure/aks-engine/blob/master/docs/howto/tr

Please refer to this [article](https://docs.microsoft.com/en-us/azure/azure-stack/user/azure-stack-solution-template-kubernetes-trouble) for specifics about how the `Kubernetes Cluster` marketplace item works on Azure Stack.

Follow this [article](https://docs.microsoft.com/azure-stack/user/azure-stack-version-profiles-azurecli2) to configure and login to your Azure Stack instance using Azure CLI

## Gathering logs

The Bash scripts on this directory are aim to simplify the collection of relevant logs from your Kubernetes cluster. Instead of SSH-ing into the cluster nodes, you can simply download and execute script `getkuberneteslogs.sh` and wait for the logs to be saved back into your workstation.
The Bash scripts on this directory are aim to simplify the collection of relevant logs from your Kubernetes cluster. Instead of SSH-ing into the cluster nodes, you can simply download and extract the latest [release](https://github.com/msazurestackworkloads/azurestack-gallery/releases/download/diagnosis-v0.1.0/diagnosis.zip) and execute script `getkuberneteslogs.sh`

These are the logs retrieved by the script:

- Microsoft Azure Linux Agent (waagent) logs
- Cloud-init logs
- Custom Script Extension logs
- Running Docker container metadata
- Running Docker container logs
- Running kube-system container metadata
- Running kube-system container logs
- Kubelet service status and journal
- Etcd service status and journal
- Gallery item's DVM logs
- kube-system Snapshot

## Required Parameters

`-u, --user` - The administrator username for the cluster VMs

`-i, --identity-file` - RSA private key tied to the public key used to create the Kubernetes cluster (usually named 'id_rsa')

`-g, --resource-group` - Kubernetes cluster resource group

## Optional Parameters

`-n, --user-namespace` - Collect logs from containers in the specified namespaces (`kube-system` logs are always collected)

`--disable-host-key-checking` - Sets SSH's `StrictHostKeyChecking` option to `no` while the script executes. Only use in a safe environment.

`--upload-logs` - Persists retrieved logs in an Azure Stack storage account. Logs can be found in `KubernetesLogs` resource group.

Please be aware that the log collector script needs to update file `~/.ssh/config` in order to connect to the cluster's worker nodes. While the script will try to back it up and then restore it once the process is complete, it may be a good a idea to create your own copy.
`--api-model` - Persists apimodel.json file in an Azure Stack Storage account.
Upload apimodel.json file to storage account happens when `--upload-logs` parameter is also provided.

After the log collection process is complete, the script will also try to look for common issues or misconfigurations. If any of those are found, they will be saved in file `ALL_ERRORS.txt`.