We have couple of clusters running in Azure using AKS service. In clusters we are running multiple projects, each one of them has different namespace, naturally.
I would like to extract data about number of pods, their status and conditions etc. for specific namespace.
It is fairly easy to do locally using AZ CLI
and installing kubectl
(to get namespaces names) and then we can either stay in kubectl
or use powershell Az.Aks
module to extract these information.
I would like to have this process fully automated and scheduled. My first thought was Azure Runbook but it is not supporting AZ CLI.
What would be the best way to achieve what I have mentioned above? I believe the best way would be to use only kubectl
commands, but how can we trigger them automatically? Is a pipeline in Azure Devops a solution?
Thanks, Rafal
You can use Azure Automation via RUnbooks, but just like Azure CLI you were trying you can do it through PowerShell. Runbooks can also be done using Python but for now only Python 2 is supported, and the same task can be done using Azure Functions but with so many different languages like C#, Java, Python and so many more.
Azure Functions https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell