Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Network | Monitoring » How to use Container Insights for Azure Kubernetes Workload

How to use Container Insights for Azure Kubernetes Workload

Posted on 19/09/202126/11/2024 Raphael Gab-Momoh By Raphael Gab-Momoh 2 Comments on How to use Container Insights for Azure Kubernetes Workload
Container-insights-1

When deploying a production-grade workload, there is the need to make sure that the agent nodes are working the way they should. This is because Azure works to sure that the master node is working well and fine. Nonetheless, our only headache is the agent nodes or worker nodes. In this guide, I will walk you through how to use container insight for Azure Kubernetes , while ensuring our container workload is alright. Kindly refer to these related guides: How to create a static pod in Kubernetes with demos that can help you become a better Kubernetes administrator and how to create and deliver a report on System Utilization on a Linux-based OS.

Azure Monitor gathers information from Azure resources, apps, and operating systems. In our example, it collected its data from a special feature in the Azure monitor called container insight.  The type of data collected depends on the resource, and it might be a metric, a log, or both, which is then utilized for analysis, visualization, alerts, automation, and other purposes.

Container Insight

Container Insight is a feature of Azure monitor that can be used to monitor an Azure Kubernetes workload. Thus, before we proceed, we need to create an AKS cluster. Creating an AKS cluster requires the following:

1. An account set up in portal www.portal.azure.com
2. Azure Cli installed on our local machine you can get the cli from https://docs.microsoft.com/en-us/cli/azure/

once you log in, you are all set up and start working ( I still use my account from school days because I get free Azure credits with it, so you might want to make good use of your student email from your university days to verify in your usual azure account and you will have the benefits as well )

Container insights for Azure kubernetes-az-login
fig1. interaction in PowerShell after installing Azure CLI

Steps to create an AKS Cluster

  1. From your portal locate resources
  2. click on containers
  3. Cluster details: we have to make sure that Preset configuration is Standard ($$). you can look at the link for more help Cluster configuration presets in the Azure portal.
  4. Add Kubernetes cluster name, such as techDirectArchive Cluster
  5. pick your desired  Region and Kubernetes version for the AKS cluster.
  6. Primary node pool:Leave the default values selected but you should reduce the maximum node count from the default or else you will get an error. When you see a validation passed just as in fig 3 below you are good to go
Container insights for Azure kubernetes-aks-cluster
fig 2. cluster configuration
Container insights for Azure kubernetes-validation
fig 3. validation checked

The completion process might take up to 5 minutes or more

Container insights for Azure kubernetes-succeeded
fig 3 running cluster

Enable Container Insights for Azure Kubernetes

To access the newly created techDirectArchieve cluster and enable “container insights for Azure Kubernetes,” ensure you follow these steps.

If you’re utilizing PowerShell, verify that you have installed Azure CLI. Alternatively, you can utilize cloud shell on the top right-hand side of the portal. When using cloud shell, remember to mount storage before proceeding

az aks get-credentials --resource-group techdirectarchive --name techDirectArchive
Container insights for Azure kubernetes-cloud-shell
fig 4 connected cloud shell to our running cluster
if we inspect the nodes with kubectl get nodes
kubectl-get-nodes-3
fig 5 node inspection

we have only one as a result of our initial configuration of node-pool. Next, we need to make our application up and running. We need to create an empty manifest file so that we can declare all the parameters that our app will have

vi techdirectarchive-vote.yaml
yamlaa
fig 6 pod definition file
kubectl apply -f techdirectarchive-vote.yaml
techdirectarchivevoteyaml
fig 7 output of our pod definition file

As we can see above, we’ve created deployment and service. Before we proceed to use container insight to monitor our application, let’s test it to see if it’s running.

kubectl get service techdirectarchive-vote-front --watch

It returns an external IP address that can be used to display the app on a browser. use CTRL-C to stop the kubectl watch the process and return to the normal prompt

external-ip
fig 8 watching the process

Monitor Containers for Azure

Now that the container is up and running, we will focus on how to use container insight to get metrics about our running container. Container insight gets automatically enable with every running container. To locate the container from insight, follow the guide below

Check Azure Kubernetes resource in Azure portal  
look for monitoring and then choose Insights.
At the top, click on + Add Filter.
Select Namespace as the property, then choose <All but kube-system>.
Select Containers to view them.
rga
fig 9. cluster-info page

The performance of workloads deployed in Kubernetes clusters may be monitored using Container Insights. Container insights may display performance by utilizing the Metrics API to collect data from Kubernetes containers. Logs from containers are also collected.

From the image, under the monitoring section on left, click on insights

filtercontainer
fig 10. container insight configuration page of our created cluster

From the image, click add filter and choose namespace for property for value select <all but kube-system>

second-to-last-az
fig 11. container details

Log Analytics for Azure Kubernetes

From the image, at the right-hand side, the view in analytics and open in another window to view logs about the container. From our pod definition file our container was callled azure-vote-back and Azure-vote-front The logs include the stdout and stderr streams from azure-vote-back and azure-vote-front containers.

finallogs
fig 12. container logs

In Summary, to be able to monitor an AKS workload, first of all, we needed to create the cluster and connected it to it using the resource group name (techdirectarchive)and the cluster name(techDirectArchive).

Next, we created the application( azure-vote-back) in our example using vi editor. When we ran the kubectl apply -f against our pod definition file we got deployment and service as shown in fig 7, showing that the container was successfully created.

Finally, Microsoft Azure Monitor provides a centralized platform for measuring and monitoring the performance of your apps and systems, as well as the resources they use. Custom performance tracking can also be achieved by combining Azure Monitor with a variety of other systems and utilizing custom log queries. Guess by now, you know how to use container insights for Azure Kubernetes.

Cloud resources consume money so please, make sure you have deleted the Kubernetes cluster when you are finally done with practicing along. lastly, please  let us know if you found this Azure Kubernetes Cluster and Container Insight guide helpful in the comments section below.
5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Network | Monitoring Tags:Azure Monitor, Kubernetes

Post navigation

Previous Post: Creating and Deploying Docker Registry Using Docker Image
Next Post: How To Deploy Azure VMware Solution Private Cloud

Related Posts

  • elastic ip association error screen
    Fix Elastic IP Address Could not be Associated AWS/Azure/OpenShift
  • Watchguard Firewall 180504 100511
    WatchGuard Log and Report Server Installation in a VM Network | Monitoring
  • Screenshot 2020 06 22 at 10.17.18
    How to disable Outlook and Yahoo Auto-Complete Network | Monitoring
  • Hub Transport 1
    Hub Transport Server: Resolving ‘Failed to Reach Running Status’ Network | Monitoring
  • Featured image wifipass
    Find saved Wi-Fi Passwords in Windows 10 and 11 Network | Monitoring
  • ACMP Defender Management
    How to Manage Microsoft Defender Antivirus with Argon ACMP Network | Monitoring

More Related Articles

elastic ip association error screen Fix Elastic IP Address Could not be Associated AWS/Azure/OpenShift
Watchguard Firewall 180504 100511 WatchGuard Log and Report Server Installation in a VM Network | Monitoring
Screenshot 2020 06 22 at 10.17.18 How to disable Outlook and Yahoo Auto-Complete Network | Monitoring
Hub Transport 1 Hub Transport Server: Resolving ‘Failed to Reach Running Status’ Network | Monitoring
Featured image wifipass Find saved Wi-Fi Passwords in Windows 10 and 11 Network | Monitoring
ACMP Defender Management How to Manage Microsoft Defender Antivirus with Argon ACMP Network | Monitoring

Comments (2) on “How to use Container Insights for Azure Kubernetes Workload”

  1. Avatar photo thiyagi says:
    26/11/2024 at 8:45 PM

    Nice Article, was helpful 🙂

    Log in to Reply
    1. chris Christian says:
      26/11/2024 at 9:24 PM

      Thank you for your kind words!

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • Remove Nextcloud Desktop Client
    How to correctly uninstall Nextcloud from Mac Mac
  • fix Client Certificate Mapping Authentication error
    How to fix Client Certificate Mapping Authentication error Backup
  • ADDS vs AD LDS
    Differences between AD LDS and AD DS Windows
  • Internet Explorer
    How to uninstall Internet Explorer from your Windows Device Windows
  • Install Lets Encrypt Certificate on Windows with Certbot
    Install Lets Encrypt Certificate on Windows with Certbot Web Server
  • windows update 03
    Check if Windows Updates were installed via the Registry Editor Windows
  • Norton 360 Error
    Norton Autofix identified an issue: Fix Norton 360 Installation has encountered an error 8404 on Windows Anti-Virus Solution
  • AppLocker
    Fix unable to start the Application Identity Service Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,821 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.