Where are kubelet logs in AKS stored?

Viewed 83

I would like to view kubelet logs going back in time in Azure AKS. All I could find from Azure docs was how to ssh into the nodes and list the logs (https://docs.microsoft.com/en-us/azure/aks/kubelet-logs) but I feel like this has to be aggregated in Log Analytics somewhere right ?

However I wasn't able to find anything in Log Analytics for Kubernetes. Am I missing something ?

We have omsagent daemonset installed and Microsoft.OperationalInsights/workspaces is enabled

Thanks :)

1 Answers

I tried to reproduce this issue in my environment and got below results:

I created resource group and VM by setting up the Subscription

az account set --subscription "subscription_name"
az group create --location westus resourcegroup_name

https://i.imgur.com/WaF4Ujl.png

  • created the AKS Cluster with the parameter to enable the AKS Container Insights
  • The following Example will creates the Cluster with name AKSRG.

az aks create -g myResourceGroup -n resourceGroup_name --enable-managed-identity --node-count 1 --enable-addons monitoring --enable-msi-auth-for-monitoring --generate-ssh-keys

https://i.imgur.com/wesUd9I.png

  • Here I have configured the kubectl to connect the kubernetes cluster with the get-credentials command

https://i.imgur.com/eNv0sjI.png

I have created the interactive shell connection to the node using kubectl debug

kubectl debug node/pod_name -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0

https://i.imgur.com/2wQSzIs.png I have used the below Command in after hash(#) tag

journalctl -u kubelet -o cat

To get the logs check the nodes and pods

https://i.imgur.com/nU65SNF.png

https://i.imgur.com/xdlHson.png

We can use the below command to check the KUBE LOGS

kubectl logs pod_name

https://i.imgur.com/nH7mt7y.png

Reference:

View kubelet logs in Azure Kubernetes Service (AKS) - Azure Kubernetes Service | Microsoft Docs

Related