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
  • DC 3
    How to demote and remove a Domain Controller on Windows Servers Windows Server
  • How To Backup Your WordPress Database banner
    How to Backup and Restore your WordPress Files and Database Backup
  • Add or remove features   fix dotnet framework issues
    Fix the request to add or remove features on the specified server failed Windows
  • Feature image OCS inventory
    Install and use OCS inventory on Windows Windows
  • chamedk8s featured
    Install CNF Certified Kubernetes in AWS AWS/Azure/OpenShift
  • screenshot 2020 03 14 at 16.23.23
    Change Windows Desktop icon shortcut for fast user switching Windows
  • microsoft edge
    How to forcefully remove Microsoft Edge Browser the hard way from your Windows device Windows
  • fast user switching in windows 10 1
    Fast user switching: How to create a desktop shortcut in Windows 10 to switch User Accounts Windows

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.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to 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

  • TZ
    TFTP Image to Flash: Copying Guide for Cisco ASA Network | Monitoring
  • Open Outlook links from your default browser
    How to stop Outlook from opening links in Edge Browser Network | Monitoring
  • troubleshooting Active Directory Replication
    How to troubleshoot Active Directory Replication issues Network | Monitoring
  • Screenshot 2020 05 14 at 19.09.08
    How to backup a Cisco IOS Network | Monitoring
  • Different Class IP Address
    Classes of IP Address: Understanding IP Address Classification Network | Monitoring
  • Featured image   Network Access Permission...
    Fix You Might Not Have Permission to Use This Network Resource Error Network | Monitoring

More Related Articles

TZ TFTP Image to Flash: Copying Guide for Cisco ASA Network | Monitoring
Open Outlook links from your default browser How to stop Outlook from opening links in Edge Browser Network | Monitoring
troubleshooting Active Directory Replication How to troubleshoot Active Directory Replication issues Network | Monitoring
Screenshot 2020 05 14 at 19.09.08 How to backup a Cisco IOS Network | Monitoring
Different Class IP Address Classes of IP Address: Understanding IP Address Classification Network | Monitoring
Featured image   Network Access Permission... Fix You Might Not Have Permission to Use This Network Resource Error 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

sysadmin top30a

  • DC 3
    How to demote and remove a Domain Controller on Windows Servers Windows Server
  • How To Backup Your WordPress Database banner
    How to Backup and Restore your WordPress Files and Database Backup
  • Add or remove features   fix dotnet framework issues
    Fix the request to add or remove features on the specified server failed Windows
  • Feature image OCS inventory
    Install and use OCS inventory on Windows Windows
  • chamedk8s featured
    Install CNF Certified Kubernetes in AWS AWS/Azure/OpenShift
  • screenshot 2020 03 14 at 16.23.23
    Change Windows Desktop icon shortcut for fast user switching Windows
  • microsoft edge
    How to forcefully remove Microsoft Edge Browser the hard way from your Windows device Windows
  • fast user switching in windows 10 1
    Fast user switching: How to create a desktop shortcut in Windows 10 to switch User Accounts 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,836 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 AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.