Consultas para a tabela KubePodInventory
Pods no ciclo de falha
Determina se os Pods/Contentores têm Crash-Loop fase.
//Determines whether Pods/Containers has Crash-Loop phase
KubePodInventory
| where ContainerStatus == 'waiting'
| where ContainerStatusReason == 'CrashLoopBackOff' or ContainerStatusReason == 'Error'
| extend ContainerLastStatus=todynamic(ContainerLastStatus)
| summarize RestartCount = arg_max(ContainerRestartCount, Computer, Namespace, ContainerLastStatus.reason) by Name
Pods no estado pendente
Verifique os Pods que não podem ser iniciados e a hora pendente.
//Check Pods that cannot be started and its pending time
KubePodInventory
| where PodStatus == 'Pending'
| project PodCreationTimeStamp, Namespace, PodStartTime, PodStatus, Name, ContainerStatus
| summarize Start = any(PodCreationTimeStamp), arg_max(PodStartTime, Namespace) by Name
| extend PodStartTime = iff(isnull(PodStartTime), now(), PodStartTime)
| extend PendingTime = PodStartTime - Start
| project Name, Namespace ,PendingTime
Localizar no KubePodInventory
Localize no KubePodInventory para procurar um valor específico na tabela KubePodInventory./nNote que esta consulta requer a atualização do <parâmetro SeachValue> para produzir resultados
// This query requires a parameter to run. Enter value in SearchValue to find in table.
let SearchValue = "<SearchValue>";//Please update term you would like to find in the table.
KubePodInventory
| where * contains tostring(SearchValue)
| take 1000
Comentários
https://aka.ms/ContentUserFeedback.
Brevemente: Ao longo de 2024, vamos descontinuar progressivamente o GitHub Issues como mecanismo de feedback para conteúdos e substituí-lo por um novo sistema de feedback. Para obter mais informações, veja:Submeter e ver comentários