Skip to content

Commit

Permalink
fix logs collection issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiaxun Song committed Jan 27, 2022
1 parent c595511 commit 19ad87b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion diagnosis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ az account set --subscription <Subscription ID>
# download the scripts.
mkdir -p $HOME/kuberneteslogs
cd $HOME/kuberneteslogs
curl -L https://github.com/msazurestackworkloads/azurestack-gallery/releases/download/diagnosis-v1.1.0/diagnosis-v1.1.0.tar.gz -o diagnosis.tar.gz
curl -L https://github.com/msazurestackworkloads/azurestack-gallery/releases/download/diagnosis-v1.2.0/diagnosis-v1.2.0.tar.gz -o diagnosis.tar.gz
tar xvf diagnosis.tar.gz

# use the script to collect logs
Expand Down
3 changes: 1 addition & 2 deletions diagnosis/azs-collect-windows-logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,4 @@ Get-ChildItem "$($ENV:TEMP)\waagent" | Foreach-Object {
Write-Host "Compressing all logs to $zipName"
$paths | Format-Table FullName, Length -AutoSize
Compress-Archive -LiteralPath $paths -DestinationPath $zipName
Remove-Item -Path $paths -ErrorAction SilentlyContinue
Get-ChildItem $zipName # this puts a FileInfo on the pipeline so that another script can get it on the pipeline
Remove-Item -Path $paths -Recurse -Confirm:$false -Force -ErrorAction SilentlyContinue
6 changes: 3 additions & 3 deletions diagnosis/hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ test -n "${NAMESPACES}" && NAMESPACES="kube-system${NAMESPACES}" && echo "[$(dat

if [ -z "${NAMESPACES}" ];
then
kubectl cluster-info dump --all-namespaces --output-directory ${LOGDIRECTORY} &> /dev/null
sudo kubectl cluster-info dump --all-namespaces --output-directory ${LOGDIRECTORY} --kubeconfig /etc/kubernetes/admin.conf &> /dev/null
else
kubectl cluster-info dump --namespaces "${NAMESPACES}" --output-directory ${LOGDIRECTORY} &> /dev/null
sudo kubectl cluster-info dump --namespaces "${NAMESPACES}" --output-directory ${LOGDIRECTORY} --kubeconfig /etc/kubernetes/admin.conf &> /dev/null
fi

(cd $TMP && zip -q -r ~/${WD}.zip ${WD})
(cd $TMP && sudo zip -q -r ~/${WD}.zip ${WD} && sudo chmod 777 ~/${WD}.zip)
sudo rm -f -r $TMP

0 comments on commit 19ad87b

Please sign in to comment.